Package org.hibernate.dialect.pagination
Class LimitOffsetLimitHandler
- java.lang.Object
-
- org.hibernate.dialect.pagination.AbstractLimitHandler
-
- org.hibernate.dialect.pagination.AbstractSimpleLimitHandler
-
- org.hibernate.dialect.pagination.LimitOffsetLimitHandler
-
- All Implemented Interfaces:
LimitHandler
public class LimitOffsetLimitHandler extends AbstractSimpleLimitHandler
ALimitHandler
for databases like PostgreSQL, H2, and HSQL that support the syntaxLIMIT n OFFSET m
. Note that this syntax does not allow specification of an offset without a limit.
-
-
Field Summary
Fields Modifier and Type Field Description static LimitOffsetLimitHandler
INSTANCE
static LimitOffsetLimitHandler
OFFSET_ONLY_INSTANCE
-
Fields inherited from class org.hibernate.dialect.pagination.AbstractLimitHandler
NO_LIMIT
-
-
Constructor Summary
Constructors Constructor Description LimitOffsetLimitHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
bindLimitParametersInReverseOrder()
Usually, the offset comes before the limit, but occasionally the offset is specified after the limit.protected String
limitClause(boolean hasFirstRow)
protected String
offsetOnlyClause()
boolean
supportsOffset()
Does this handler support offsetting query results without also specifying a limit?-
Methods inherited from class org.hibernate.dialect.pagination.AbstractSimpleLimitHandler
insert, processSql, supportsLimit, supportsVariableLimit
-
Methods inherited from class org.hibernate.dialect.pagination.AbstractLimitHandler
bindLimitParameters, bindLimitParametersAtEndOfQuery, bindLimitParametersAtStartOfQuery, bindLimitParametersFirst, 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
processSql
-
-
-
-
Field Detail
-
INSTANCE
public static LimitOffsetLimitHandler INSTANCE
-
OFFSET_ONLY_INSTANCE
public static LimitOffsetLimitHandler OFFSET_ONLY_INSTANCE
-
-
Method Detail
-
limitClause
protected String limitClause(boolean hasFirstRow)
- Specified by:
limitClause
in classAbstractSimpleLimitHandler
-
offsetOnlyClause
protected String offsetOnlyClause()
- Overrides:
offsetOnlyClause
in classAbstractSimpleLimitHandler
-
bindLimitParametersInReverseOrder
public final boolean bindLimitParametersInReverseOrder()
Description copied from class:AbstractLimitHandler
Usually, the offset comes before the limit, but occasionally the offset is specified after the limit. Does this dialect require us to bind the parameters in reverse order?- Overrides:
bindLimitParametersInReverseOrder
in classAbstractLimitHandler
- Returns:
- true if the correct order is limit then offset
-
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 classAbstractSimpleLimitHandler
- Returns:
- True if this handler supports offset alone.
-
-