#278 - SqlQuery setFirstRow fail - modify SQL using LIMIT/OFFSET etc to support firstRows/maxRows

This commit is contained in:
Robin Bygrave
2016-05-12 20:59:52 +12:00
parent 58a36e6b67
commit 8cb8f9eabf
12 changed files with 256 additions and 60 deletions
@@ -74,19 +74,9 @@ public class DefaultRelationalQueryEngine implements RelationalQueryEngine {
try {
request.executeSql(binder);
int maxRows = request.getMaxRows();
int loadRowCount = 0;
List<SqlRow> rows = new ArrayList<SqlRow>();
while (request.next()) {
rows.add(readRow(request));
loadRowCount++;
if (loadRowCount == maxRows) {
// break, as we have hit the max rows to fetch...
break;
}
}
logSummary(request, startTime);