DB2: FIX Db2SqlLimiter & tests

This commit is contained in:
Roland Praml
2022-01-07 11:12:28 +01:00
parent 442732d70d
commit 193617a107
6 changed files with 32 additions and 23 deletions
@@ -15,10 +15,13 @@ public class Db2SqlLimiter implements SqlLimiter {
sb.append("distinct ");
}
sb.append(request.getDbSql());
int firstRow = request.getFirstRow();
if (firstRow > 0) {
sb.append(" offset ").append(firstRow).append(" rows");
}
int maxRows = request.getMaxRows();
if (maxRows > 0) {
sb.append(" ").append(NEW_LINE).append("FETCH FIRST ").append(maxRows).append(" ROWS ONLY");
sb.append(" fetch next ").append(maxRows).append(" rows only");
}
String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery());