Skip to content

Commit 4ca26f9

Browse files
committed
HHH-18309 Fix Oracle limit handler for native queries
1 parent 9ec2dbb commit 4ca26f9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

hibernate-core/src/main/java/org/hibernate/dialect/pagination/Oracle12LimitHandler.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,17 @@ public class Oracle12LimitHandler extends AbstractLimitHandler {
3333

3434
@Override
3535
public String processSql(String sql, Limit limit, QueryOptions queryOptions) {
36+
final boolean hasFirstRow = hasFirstRow( limit );
37+
final boolean hasMaxRows = hasMaxRows( limit );
38+
39+
if ( !hasFirstRow && !hasMaxRows ) {
40+
return sql;
41+
}
42+
3643
return processSql(
3744
sql,
38-
hasFirstRow( limit ),
39-
hasMaxRows( limit ),
45+
hasFirstRow,
46+
hasMaxRows,
4047
queryOptions.getLockOptions()
4148
);
4249
}

0 commit comments

Comments
 (0)