mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Generate valid SQL when firstRow is set but not maxRows
This commit is contained in:
@@ -31,13 +31,12 @@ public class LimitOffsetSqlLimiter implements SqlLimiter {
|
||||
maxRows = maxRows + 1;
|
||||
}
|
||||
|
||||
sb.append(" ").append(NEW_LINE).append(LIMIT).append(" ");
|
||||
if (maxRows > 0) {
|
||||
sb.append(maxRows);
|
||||
}
|
||||
if (firstRow > 0) {
|
||||
sb.append(" ").append(OFFSET).append(" ");
|
||||
sb.append(firstRow);
|
||||
if (maxRows > 0 || firstRow > 0) {
|
||||
sb.append(" ").append(NEW_LINE).append(LIMIT).append(" ").append(maxRows);
|
||||
if (firstRow > 0) {
|
||||
sb.append(" ").append(OFFSET).append(" ");
|
||||
sb.append(firstRow);
|
||||
}
|
||||
}
|
||||
|
||||
String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery());
|
||||
|
||||
Reference in New Issue
Block a user