diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/OracleSqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/OracleSqlAstTranslator.java index 5c051777bc..37ff98e0ee 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/OracleSqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/OracleSqlAstTranslator.java @@ -78,7 +78,7 @@ public class OracleSqlAstTranslator extends AbstractSql } if ( strategy != LockStrategy.FOLLOW_ON ) { final boolean hasOffset; - if ( querySpec.isRoot() && hasLimit() && getLimit().getFirstRowJpa() != 0 ) { + if ( querySpec.isRoot() && hasLimit() && getLimit().getFirstRow() != null ) { hasOffset = true; // We must record that the generated SQL depends on the fact that there is an offset addAppliedParameterBinding( getOffsetParameter(), null ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerSqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerSqlAstTranslator.java index c4b8d496f9..252e5d1b45 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerSqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerSqlAstTranslator.java @@ -135,8 +135,8 @@ public class SQLServerSqlAstTranslator extends Abstract final boolean hasLimit; final boolean hasOffset; if ( queryPart.isRoot() && hasLimit() ) { - hasLimit = getLimit().getMaxRowsJpa() != Integer.MAX_VALUE; - hasOffset = getLimit().getFirstRowJpa() != 0; + hasLimit = getLimit().getMaxRows() != null; + hasOffset = getLimit().getFirstRow() != null; } else { hasLimit = queryPart.getFetchClauseExpression() != null; diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java index b9d8fe140c..058aef3281 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java @@ -411,7 +411,7 @@ public abstract class AbstractSqlAstTranslator implemen } protected boolean hasOffset(QueryPart queryPart) { - if ( queryPart.isRoot() && hasLimit() && limit.getFirstRowJpa() != 0 ) { + if ( queryPart.isRoot() && hasLimit() && limit.getFirstRow() != null ) { return true; } else { diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/customtype/UnspecifiedEnumTypeTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/customtype/UnspecifiedEnumTypeTest.java index 8b2712640f..971484c496 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/customtype/UnspecifiedEnumTypeTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/customtype/UnspecifiedEnumTypeTest.java @@ -104,7 +104,7 @@ public class UnspecifiedEnumTypeTest extends BaseEnversFunctionalTestCase { @SuppressWarnings("unchecked") List values = session - .createNativeQuery( "SELECT enum1 e1, enum2 e2 FROM ENUM_ENTITY_AUD ORDER BY rev ASC" ) + .createNativeQuery( "SELECT enum1 e1, enum2 e2 FROM ENUM_ENTITY_AUD ORDER BY REV ASC" ) .addScalar( "e1", IntegerType.INSTANCE ) .addScalar( "e2", IntegerType.INSTANCE ) .list();