Added skip limit
This commit is contained in:
parent
68c742eb09
commit
b978185cd5
|
@ -123,21 +123,18 @@ public class JsonQuery {
|
|||
offset = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
int position = -1;
|
||||
int count = 0;
|
||||
|
||||
StringBuffer stringBuffer = createQuery();
|
||||
/*
|
||||
* TRAVERSE does not support SKIP
|
||||
* so we need to use post filtering strategy
|
||||
*/
|
||||
|
||||
// stringBuffer.append(" SKIP :offset");
|
||||
// stringBuffer.append(" LIMIT :limit");
|
||||
StringBuffer stringBuffer = createQuery();
|
||||
stringBuffer.append(" SKIP :offset");
|
||||
stringBuffer.append(" LIMIT :limit");
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// map.put("offset", offset);
|
||||
// map.put("limit", limit);
|
||||
map.put("offset", offset);
|
||||
map.put("limit", limit);
|
||||
|
||||
|
||||
String query = stringBuffer.toString();
|
||||
|
@ -149,9 +146,12 @@ public class JsonQuery {
|
|||
|
||||
while(resultSet.hasNext()) {
|
||||
OResult oResult = resultSet.next();
|
||||
/*
|
||||
if(++position < offset) {
|
||||
continue;
|
||||
}
|
||||
*/
|
||||
|
||||
OElement element = ElementManagementUtility.getElementFromOptional(oResult.getElement());
|
||||
|
||||
try {
|
||||
|
@ -161,9 +161,11 @@ public class JsonQuery {
|
|||
erManagement.setAsEntryPoint();
|
||||
jsonNodeResult = erManagement.serializeAsJsonNode();
|
||||
arrayNode.add(jsonNodeResult);
|
||||
/*
|
||||
if(limit > 0 && ++count >= limit) {
|
||||
break;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
|
|
Loading…
Reference in New Issue