Package org.hibernate.dialect.pagination
Class Oracle12LimitHandler
java.lang.Object
org.hibernate.dialect.pagination.AbstractLimitHandler
org.hibernate.dialect.pagination.Oracle12LimitHandler
- All Implemented Interfaces:
LimitHandler
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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanUsually, the offset comes before the limit, but occasionally the offset is specified after the limit.protected StringprocessSql(String sql, boolean hasFirstRow, boolean hasMaxRows, int jdbcParameterCount, @Nullable ParameterMarkerStrategy parameterMarkerStrategy, LockOptions lockOptions) protected StringprocessSql(String sql, boolean hasFirstRow, boolean hasMaxRows, LockOptions lockOptions) protected StringprocessSql(String sql, int forUpdateIndex, boolean hasFirstRow, boolean hasMaxRows) protected StringprocessSql(String sql, int forUpdateIndex, boolean hasFirstRow, boolean hasMaxRows, int jdbcParameterCount, @Nullable ParameterMarkerStrategy parameterMarkerStrategy) processSql(String sql, int jdbcParameterCount, @Nullable ParameterMarkerStrategy parameterMarkerStrategy, QueryOptions queryOptions) Applies the limit from theQueryOptionsto the SQL with the givenParameterMarkerStrategy.processSql(String sql, Limit limit, QueryOptions queryOptions) protected StringprocessSqlOffsetFetch(String sql, boolean hasFirstRow, boolean hasMaxRows) protected StringprocessSqlOffsetFetch(String sql, boolean hasFirstRow, boolean hasMaxRows, int jdbcParameterCount, @Nullable ParameterMarkerStrategy parameterMarkerStrategy) final booleanDoes this handler support limiting query results?booleanDoes this handler support offsetting query results without also specifying a limit?booleanDoes the limit clause expect the number of the last row, or the "page size", the maximum number of rows we want to receive? Hibernate'sQuery.setMaxResults(int)accepts the page size, so the number of the last row is obtained by adding the number of the first row, which is one greater thanQuery.setFirstResult(int).Methods inherited from class org.hibernate.dialect.pagination.AbstractLimitHandler
bindLimitParameters, bindLimitParametersAtEndOfQuery, bindLimitParametersAtStartOfQuery, bindLimitParametersFirst, convertToFirstRowValue, forceLimitUsage, getFirstRow, getForUpdatePattern, getMaxOrLimit, hasFirstRow, hasMaxRows, insertAfterDistinct, insertAfterSelect, insertAtEnd, insertBeforeForUpdate, processSql, setMaxRows, supportsLimitOffset, supportsVariableLimitMethods 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
getParameterPositionStart, processSqlMutatesState
-
Field Details
-
INSTANCE
-
-
Method Details
-
processSql
-
processSql
public String processSql(String sql, int jdbcParameterCount, @Nullable ParameterMarkerStrategy parameterMarkerStrategy, QueryOptions queryOptions) Description copied from interface:LimitHandlerApplies the limit from theQueryOptionsto the SQL with the givenParameterMarkerStrategy. -
processSql
protected String processSql(String sql, boolean hasFirstRow, boolean hasMaxRows, LockOptions lockOptions) -
processSql
protected String processSql(String sql, boolean hasFirstRow, boolean hasMaxRows, int jdbcParameterCount, @Nullable ParameterMarkerStrategy parameterMarkerStrategy, LockOptions lockOptions) -
processSqlOffsetFetch
-
processSqlOffsetFetch
protected String processSqlOffsetFetch(String sql, boolean hasFirstRow, boolean hasMaxRows, int jdbcParameterCount, @Nullable ParameterMarkerStrategy parameterMarkerStrategy) -
processSql
-
processSql
protected String processSql(String sql, int forUpdateIndex, boolean hasFirstRow, boolean hasMaxRows, int jdbcParameterCount, @Nullable ParameterMarkerStrategy parameterMarkerStrategy) -
supportsLimit
public final boolean supportsLimit()Description copied from interface:LimitHandlerDoes this handler support limiting query results?- Specified by:
supportsLimitin interfaceLimitHandler- Overrides:
supportsLimitin classAbstractLimitHandler- Returns:
- True if this handler supports limit alone.
-
supportsOffset
public boolean supportsOffset()Description copied from interface:LimitHandlerDoes this handler support offsetting query results without also specifying a limit?- Specified by:
supportsOffsetin interfaceLimitHandler- Overrides:
supportsOffsetin classAbstractLimitHandler- Returns:
- True if this handler supports offset alone.
-
bindLimitParametersInReverseOrder
public boolean bindLimitParametersInReverseOrder()Description copied from class:AbstractLimitHandlerUsually, 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:
bindLimitParametersInReverseOrderin classAbstractLimitHandler- Returns:
- true if the correct order is limit then offset
-
useMaxForLimit
public boolean useMaxForLimit()Description copied from class:AbstractLimitHandlerDoes the limit clause expect the number of the last row, or the "page size", the maximum number of rows we want to receive? Hibernate'sQuery.setMaxResults(int)accepts the page size, so the number of the last row is obtained by adding the number of the first row, which is one greater thanQuery.setFirstResult(int).- Overrides:
useMaxForLimitin classAbstractLimitHandler- Returns:
- true if the limit clause expects the number of the last row, false if it expects the page size
-