Package org.hibernate.dialect.pagination
Class TopLimitHandler
java.lang.Object
org.hibernate.dialect.pagination.AbstractLimitHandler
org.hibernate.dialect.pagination.AbstractNoOffsetLimitHandler
org.hibernate.dialect.pagination.TopLimitHandler
- All Implemented Interfaces:
LimitHandler
A
LimitHandler for Transact SQL and similar
databases which support the syntax SELECT TOP n.
Note that this syntax does not allow specification of
an offset.-
Field Summary
FieldsFields inherited from class org.hibernate.dialect.pagination.AbstractLimitHandler
NO_LIMIT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDoes the offset/limit clause come at the start of theSELECTstatement, or at the end of the query?intgetParameterPositionStart(Limit limit) Returns the position at which to start binding parameters afterLimitHandler.bindLimitParametersAtStartOfQuery(Limit, PreparedStatement, int).protected Stringprotected StringThe SQL fragment to insert, with a ? placeholder for the actual numerical limit.protected StringlimitClause(int jdbcParameterCount, ParameterMarkerStrategy parameterMarkerStrategy) 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.Methods inherited from class org.hibernate.dialect.pagination.AbstractNoOffsetLimitHandler
processSql, processSql, supportsLimit, supportsLimitOffset, supportsVariableLimitMethods inherited from class org.hibernate.dialect.pagination.AbstractLimitHandler
bindLimitParameters, bindLimitParametersAtEndOfQuery, bindLimitParametersAtStartOfQuery, bindLimitParametersInReverseOrder, convertToFirstRowValue, forceLimitUsage, getFirstRow, getForUpdatePattern, getMaxOrLimit, hasFirstRow, hasMaxRows, insertAfterDistinct, insertAfterSelect, insertAtEnd, insertBeforeForUpdate, setMaxRows, supportsOffset, useMaxForLimitMethods 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
processSql
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
TopLimitHandler
public TopLimitHandler(boolean variableLimit)
-
-
Method Details
-
limitClause
Description copied from class:AbstractNoOffsetLimitHandlerThe SQL fragment to insert, with a ? placeholder for the actual numerical limit.- Specified by:
limitClausein classAbstractNoOffsetLimitHandler
-
limitClause
protected String limitClause(int jdbcParameterCount, ParameterMarkerStrategy parameterMarkerStrategy) - Overrides:
limitClausein classAbstractNoOffsetLimitHandler
-
insert
- Specified by:
insertin classAbstractNoOffsetLimitHandler
-
bindLimitParametersFirst
public boolean bindLimitParametersFirst()Description copied from class:AbstractLimitHandlerDoes the offset/limit clause come at the start of theSELECTstatement, or at the end of the query?- Specified by:
bindLimitParametersFirstin classAbstractNoOffsetLimitHandler- Returns:
- true if limit parameters come before other parameters
-
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. -
getParameterPositionStart
Description copied from interface:LimitHandlerReturns the position at which to start binding parameters afterLimitHandler.bindLimitParametersAtStartOfQuery(Limit, PreparedStatement, int).
-