mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-26 23:22:57 +00:00
1 parent
528ad7c7fb
commit
c074b7c457
5 files changed
+12
-16
No files matched your search
@@ -31,11 +31,12 @@ public class LimitOffsetSqlLimiter implements SqlLimiter {
|
||||
int firstRow = request.getFirstRow();
|
||||
int maxRows = request.getMaxRows();
|
||||
|
||||
if (maxRows > 0) {
|
||||
if (maxRows > 0 || firstRow > 0) {
|
||||
sb.append(" ").append(LIMIT).append(" ").append(maxRows);
|
||||
}
|
||||
if (firstRow > 0) {
|
||||
sb.append(" ").append(OFFSET).append(" ").append(firstRow);
|
||||
if (firstRow > 0) {
|
||||
sb.append(" ").append(OFFSET).append(" ");
|
||||
sb.append(firstRow);
|
||||
}
|
||||
}
|
||||
|
||||
String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery());
|
||||
|
||||
@@ -20,8 +20,6 @@ public class Db2SqlLimiter implements SqlLimiter {
|
||||
if (maxRows > 0) {
|
||||
sb.append(" ").append(NEW_LINE).append("FETCH FIRST ").append(maxRows).append(" ROWS ONLY");
|
||||
}
|
||||
// FIXME: There is no 'firstRow' support for DB2. Maybe we can use the MYS compatibility:
|
||||
// https://www.ibm.com/developerworks/community/blogs/SQLTips4DB2LUW/entry/limit_offset?lang=en
|
||||
|
||||
String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery());
|
||||
return new SqlLimitResponse(sql, false);
|
||||
|
||||
@@ -22,11 +22,11 @@ public class HanaSqlLimiter implements SqlLimiter {
|
||||
|
||||
if (maxRows > 0) {
|
||||
sb.append(" ").append("limit ").append(maxRows);
|
||||
if (firstRow > 0) {
|
||||
sb.append(" ").append("offset ");
|
||||
sb.append(firstRow);
|
||||
}
|
||||
}
|
||||
if (firstRow > 0) {
|
||||
sb.append(" ").append("offset ").append(firstRow);
|
||||
}
|
||||
// CHECKME: Roland Praml: as far as I see, this code does the same as 'LimotOffsetSqlLimiter'
|
||||
|
||||
String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery());
|
||||
|
||||
|
||||
Reference in new issue
Block a user