Package org.hibernate.dialect.pagination
Class Oracle12LimitHandler
- java.lang.Object
-
- org.hibernate.dialect.pagination.AbstractLimitHandler
-
- org.hibernate.dialect.pagination.Oracle12LimitHandler
-
- All Implemented Interfaces:
LimitHandler
public class Oracle12LimitHandler extends AbstractLimitHandler
ALimitHandler
for databases which support the ANSI SQL standard syntaxFETCH FIRST m ROWS ONLY
andOFFSET n ROWS FETCH NEXT m ROWS ONLY
.
-
-
Field Summary
Fields Modifier and Type Field Description static Oracle12LimitHandler
INSTANCE
-
Fields inherited from class org.hibernate.dialect.pagination.AbstractLimitHandler
NO_LIMIT
-
-
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
processSql(String sql, boolean hasFirstRow, LockOptions lockOptions)
protected String
processSql(String sql, int forUpdateIndex, boolean hasFirstRow)
String
processSql(String sql, Limit limit, QueryOptions queryOptions)
protected String
processSqlOffsetFetch(String sql, boolean hasFirstRow)
boolean
supportsLimit()
Does this handler support limiting query results?boolean
supportsOffset()
Does this handler support offsetting query results without also specifying a limit?boolean
useMaxForLimit()
Does 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, supportsVariableLimit
-
-
-
-
Field Detail
-
INSTANCE
public static final Oracle12LimitHandler INSTANCE
-
-
Method Detail
-
processSql
public String processSql(String sql, Limit limit, QueryOptions queryOptions)
-
processSql
protected String processSql(String sql, boolean hasFirstRow, LockOptions lockOptions)
-
supportsLimit
public final boolean supportsLimit()
Description copied from interface:LimitHandler
Does this handler support limiting query results?- Specified by:
supportsLimit
in interfaceLimitHandler
- Overrides:
supportsLimit
in classAbstractLimitHandler
- Returns:
- True if this handler supports limit alone.
-
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 classAbstractLimitHandler
- Returns:
- True if this handler supports offset alone.
-
bindLimitParametersInReverseOrder
public 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
-
useMaxForLimit
public boolean useMaxForLimit()
Description copied from class:AbstractLimitHandler
Does 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:
useMaxForLimit
in classAbstractLimitHandler
- Returns:
- true if the limit clause expects the number of the last row, false if it expects the page size
-
-