Skip to content

Commit 5c26759

Browse files
dreab8beikov
authored andcommitted
HHH-19314 Fix fetch clause expression value retrieval
1 parent 11b748f commit 5c26759

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6738,8 +6738,8 @@ private int getSortSelectionIndex(QuerySpec querySpec, SortSpecification sortSpe
67386738

67396739
private boolean isFetchFirstRowOnly(QueryPart queryPart) {
67406740
return queryPart.getFetchClauseType() == FetchClauseType.ROWS_ONLY
6741-
&& queryPart.getFetchClauseExpression() instanceof QueryLiteral<?> queryLiteral
6742-
&& Integer.valueOf( 1 ).equals( queryLiteral.getLiteralValue() );
6741+
&& queryPart.getFetchClauseExpression() != null
6742+
&& Integer.valueOf( 1 ).equals( getLiteralValue( queryPart.getFetchClauseExpression() ) );
67436743
}
67446744

67456745
private SelectStatement stripToSelectClause(SelectStatement statement) {

0 commit comments

Comments
 (0)