Package org.hibernate.dialect.pagination
Class LegacyDB2LimitHandler
java.lang.Object
org.hibernate.dialect.pagination.AbstractLimitHandler
org.hibernate.dialect.pagination.LegacyDB2LimitHandler
- All Implemented Interfaces:
LimitHandler
A
LimitHandler for DB2. Uses FETCH FIRST n ROWS ONLY,
together with ROWNUMBER() when there is an offset. (DB2 does
not support the ANSI syntax OFFSET n ROWS.)-
Field Summary
FieldsFields inherited from class org.hibernate.dialect.pagination.AbstractLimitHandler
NO_LIMIT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprocessSql(String sql, Limit limit) booleanReturns whetherLimitHandler.processSql(String, int, ParameterMarkerStrategy, QueryOptions)mutates the state of this limit handler and needs to be called for certain other methods to work correctly.final booleanDoes this handler support limiting query results?final booleanDoes this handler support bind variables (JDBC prepared statement parameters) for its limit/offset?final booleanDoes the limit clause expect the number of the last row, or the "page size", the maximum number of rows we want to receive? Hibernate'sQuery.setMaxResults(int)accepts the page size, so the number of the last row is obtained by adding the number of the first row, which is one greater thanQuery.setFirstResult(int).Methods inherited from class org.hibernate.dialect.pagination.AbstractLimitHandler
bindLimitParameters, bindLimitParametersAtEndOfQuery, bindLimitParametersAtStartOfQuery, bindLimitParametersFirst, bindLimitParametersInReverseOrder, convertToFirstRowValue, forceLimitUsage, getFirstRow, getForUpdatePattern, getMaxOrLimit, hasFirstRow, hasMaxRows, insertAfterDistinct, insertAfterSelect, insertAtEnd, insertBeforeForUpdate, setMaxRows, supportsLimitOffset, supportsOffsetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.dialect.pagination.LimitHandler
getParameterPositionStart, processSql, processSql
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
LegacyDB2LimitHandler
public LegacyDB2LimitHandler()
-
-
Method Details
-
processSql
- Specified by:
processSqlin interfaceLimitHandler- Overrides:
processSqlin classAbstractLimitHandler
-
supportsLimit
public final boolean supportsLimit()Description copied from interface:LimitHandlerDoes this handler support limiting query results?- Specified by:
supportsLimitin interfaceLimitHandler- Overrides:
supportsLimitin classAbstractLimitHandler- Returns:
- True if this handler supports limit alone.
-
useMaxForLimit
public final boolean useMaxForLimit()Description copied from class:AbstractLimitHandlerDoes the limit clause expect the number of the last row, or the "page size", the maximum number of rows we want to receive? Hibernate'sQuery.setMaxResults(int)accepts the page size, so the number of the last row is obtained by adding the number of the first row, which is one greater thanQuery.setFirstResult(int).- Overrides:
useMaxForLimitin classAbstractLimitHandler- Returns:
- true if the limit clause expects the number of the last row, false if it expects the page size
-
supportsVariableLimit
public final boolean supportsVariableLimit()Description copied from class:AbstractLimitHandlerDoes this handler support bind variables (JDBC prepared statement parameters) for its limit/offset?- Overrides:
supportsVariableLimitin classAbstractLimitHandler- Returns:
- true if bind variables can be used
-
processSqlMutatesState
public boolean processSqlMutatesState()Description copied from interface:LimitHandlerReturns whetherLimitHandler.processSql(String, int, ParameterMarkerStrategy, QueryOptions)mutates the state of this limit handler and needs to be called for certain other methods to work correctly.
-