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 TypeMethodDescriptionint
bindLimitParametersAtEndOfQuery
(Limit limit, PreparedStatement statement, int index) int
bindLimitParametersAtStartOfQuery
(Limit limit, PreparedStatement statement, int index) default int
getParameterPositionStart
(Limit limit) Returns the position at which to start binding parameters afterbindLimitParametersAtStartOfQuery(Limit, PreparedStatement, int)
.default String
processSql
(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) Deprecated, for removal: This API element is subject to removal in a future version.default String
processSql
(String sql, Limit limit, QueryOptions queryOptions) Deprecated, for removal: This API element is subject to removal in a future version.default boolean
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.void
setMaxRows
(Limit limit, PreparedStatement statement) boolean
Does this handler support limiting query results?boolean
Does this handler support combinations of limit and offset?boolean
Does 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 theQueryOptions
to 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
-