Package org.hibernate.dialect.pagination
Class OffsetFetchLimitHandler
java.lang.Object
org.hibernate.dialect.pagination.AbstractLimitHandler
org.hibernate.dialect.pagination.OffsetFetchLimitHandler
- All Implemented Interfaces:
LimitHandler
- Direct Known Subclasses:
DB2LimitHandler
,SQLServer2012LimitHandler
A
LimitHandler
for databases which support the
ANSI SQL standard syntax FETCH FIRST m ROWS ONLY
and OFFSET n ROWS FETCH NEXT m ROWS ONLY
.-
Field Summary
FieldsFields inherited from class org.hibernate.dialect.pagination.AbstractLimitHandler
NO_LIMIT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprocessSql
(String sql, int jdbcParameterCount, @Nullable ParameterMarkerStrategy parameterMarkerStrategy, QueryOptions queryOptions) Applies the limit from theQueryOptions
to the SQL with the givenParameterMarkerStrategy
.processSql
(String sql, Limit limit) boolean
Returns 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.protected boolean
final boolean
Does this handler support limiting query results?boolean
Does this handler support offsetting query results without also specifying a limit?final boolean
Does this handler support bind variables (JDBC prepared statement parameters) for its limit/offset?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, useMaxForLimit
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.dialect.pagination.LimitHandler
getParameterPositionStart, processSql
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
OffsetFetchLimitHandler
public OffsetFetchLimitHandler(boolean variableLimit)
-
-
Method Details
-
processSql
public String processSql(String sql, int jdbcParameterCount, @Nullable ParameterMarkerStrategy parameterMarkerStrategy, QueryOptions queryOptions) Description copied from interface:LimitHandler
Applies the limit from theQueryOptions
to the SQL with the givenParameterMarkerStrategy
. -
processSql
- Specified by:
processSql
in interfaceLimitHandler
- Overrides:
processSql
in classAbstractLimitHandler
-
supportsLimit
public final boolean supportsLimit()Description copied from interface:LimitHandler
Does this handler support limiting query results?- Specified by:
supportsLimit
in interfaceLimitHandler
- Overrides:
supportsLimit
in classAbstractLimitHandler
- Returns:
- True if this handler supports limit alone.
-
supportsOffset
public boolean supportsOffset()Description copied from interface:LimitHandler
Does this handler support offsetting query results without also specifying a limit?- Specified by:
supportsOffset
in interfaceLimitHandler
- Overrides:
supportsOffset
in classAbstractLimitHandler
- Returns:
- True if this handler supports offset alone.
-
supportsVariableLimit
public final boolean supportsVariableLimit()Description copied from class:AbstractLimitHandler
Does this handler support bind variables (JDBC prepared statement parameters) for its limit/offset?- Overrides:
supportsVariableLimit
in classAbstractLimitHandler
- Returns:
- true if bind variables can be used
-
renderOffsetRowsKeyword
protected boolean renderOffsetRowsKeyword() -
processSqlMutatesState
public boolean processSqlMutatesState()Description copied from interface:LimitHandler
Returns 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.
-