Package org.hibernate.dialect.pagination
Interface LimitHandler
- All Known Implementing Classes:
AbstractLimitHandler,AbstractNoOffsetLimitHandler,AbstractSimpleLimitHandler,DB2LimitHandler,FetchLimitHandler,LegacyDB2LimitHandler,LimitLimitHandler,LimitOffsetLimitHandler,NoopLimitHandler,OffsetFetchLimitHandler,Oracle12LimitHandler,SQLServer2012LimitHandler,TopLimitHandler
public interface LimitHandler
Contract defining dialect-specific limit and offset handling.
Most implementations extend
AbstractLimitHandler.-
Method Summary
Modifier and TypeMethodDescriptionintbindLimitParametersAtEndOfQuery(Limit limit, PreparedStatement statement, int index) intbindLimitParametersAtStartOfQuery(Limit limit, PreparedStatement statement, int index) default intgetParameterPositionStart(Limit limit) Returns the position at which to start binding parameters afterbindLimitParametersAtStartOfQuery(Limit, PreparedStatement, int).default StringprocessSql(String sql, int jdbcParameterCount, @Nullable ParameterMarkerStrategy parameterMarkerStrategy, QueryOptions queryOptions) Applies the limit from theQueryOptionsto the SQL with the givenParameterMarkerStrategy.processSql(String sql, Limit limit) Deprecated, for removal: This API element is subject to removal in a future version.default StringprocessSql(String sql, Limit limit, QueryOptions queryOptions) Deprecated, for removal: This API element is subject to removal in a future version.default booleanReturns whetherprocessSql(String, int, ParameterMarkerStrategy, QueryOptions)mutates the state of this limit handler and needs to be called for certain other methods to work correctly.voidsetMaxRows(Limit limit, PreparedStatement statement) booleanDoes this handler support limiting query results?booleanDoes this handler support combinations of limit and offset?booleanDoes this handler support offsetting query results without also specifying a limit?
-
Method Details
-
supportsLimit
boolean supportsLimit()Does this handler support limiting query results?- Returns:
- True if this handler supports limit alone.
-
supportsOffset
boolean supportsOffset()Does this handler support offsetting query results without also specifying a limit?- Returns:
- True if this handler supports offset alone.
-
supportsLimitOffset
boolean supportsLimitOffset()Does this handler support combinations of limit and offset?- Returns:
- True if the handler supports an offset within the limit support.
-
processSql
Deprecated, for removal: This API element is subject to removal in a future version. -
processSql
@Deprecated(forRemoval=true) default String processSql(String sql, Limit limit, QueryOptions queryOptions) Deprecated, for removal: This API element is subject to removal in a future version. -
processSql
default String processSql(String sql, int jdbcParameterCount, @Nullable ParameterMarkerStrategy parameterMarkerStrategy, QueryOptions queryOptions) Applies the limit from theQueryOptionsto the SQL with the givenParameterMarkerStrategy.- Since:
- 7.1
-
bindLimitParametersAtStartOfQuery
int bindLimitParametersAtStartOfQuery(Limit limit, PreparedStatement statement, int index) throws SQLException - Throws:
SQLException
-
bindLimitParametersAtEndOfQuery
int bindLimitParametersAtEndOfQuery(Limit limit, PreparedStatement statement, int index) throws SQLException - Throws:
SQLException
-
processSqlMutatesState
default boolean processSqlMutatesState()Returns whetherprocessSql(String, int, ParameterMarkerStrategy, QueryOptions)mutates the state of this limit handler and needs to be called for certain other methods to work correctly.- Since:
- 7.1
-
getParameterPositionStart
Returns the position at which to start binding parameters afterbindLimitParametersAtStartOfQuery(Limit, PreparedStatement, int).- Since:
- 7.1
-
setMaxRows
- Throws:
SQLException
-