Permalink
Browse files

Cleaned the code for better documentation

  • Loading branch information...
easility committed Oct 25, 2012
1 parent 9e4f609 commit fd3119ac6e1552c33f7065cd0dcfa933bc1a31e7
Showing with 8 additions and 10 deletions.
  1. +8 −10 examples/example/src/com/example/PlayORMExample.java
@@ -31,25 +31,23 @@ public static void main(String[] args) {
createTestData();
processSQL(args);
}
-
+ /**
+ *
+ * Process the SQL query which is inserted as an command line arguments
+ */
private static void processSQL(String[] args){
- StringBuilder builder = new StringBuilder();
- for(String s : args) {
- builder.append(s);
- builder.append(" ");
- }
NoSqlTypedSession ntsession = mgr.getTypedSession();
- QueryResult result = ntsession.createQueryCursor(builder.toString(), 50);
+ QueryResult result = ntsession.createQueryCursor(args[0], 50);
Cursor<List<TypedRow>> cursor = result.getAllViewsCursor();
processBatch(cursor);
}
/**
*
* Print all the values inside the cursor
*/
- private static void processBatch(Cursor<List<TypedRow>> rowsIter) {
- while(rowsIter.next()) {
- List<TypedRow> joinedRow = rowsIter.getCurrent();
+ private static void processBatch(Cursor<List<TypedRow>> cursor) {
+ while(cursor.next()) {
+ List<TypedRow> joinedRow = cursor.getCurrent();
for(TypedRow r: joinedRow) {
if (r!=null){
DboTableMeta meta = r.getView().getTableMeta();

0 comments on commit fd3119a

Please sign in to comment.