Package org.hibernate.dialect.pagination
Class LegacyOracleLimitHandler
java.lang.Object
org.hibernate.dialect.pagination.AbstractLimitHandler
org.hibernate.dialect.pagination.LegacyOracleLimitHandler
- All Implemented Interfaces:
LimitHandler
A
LimitHandler
for Oracle prior to 12c, which uses ROWNUM
.-
Field Summary
Fields inherited from class org.hibernate.dialect.pagination.AbstractLimitHandler
NO_LIMIT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Usually, the offset comes before the limit, but occasionally the offset is specified after the limit.boolean
Generally, if there is no limit applied to a Hibernate query we do not apply any limits to the SQL query.processSql
(String sql, Limit limit) boolean
Does this handler support limiting query results?boolean
Does this handler support offsetting query results without also specifying a limit?boolean
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, getFirstRow, getForUpdatePattern, getMaxOrLimit, hasFirstRow, hasMaxRows, insertAfterDistinct, insertAfterSelect, insertAtEnd, insertBeforeForUpdate, setMaxRows, supportsLimitOffset, supportsVariableLimit
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.dialect.pagination.LimitHandler
processSql
-
Constructor Details
-
LegacyOracleLimitHandler
-
-
Method Details
-
processSql
- Specified by:
processSql
in interfaceLimitHandler
- Overrides:
processSql
in classAbstractLimitHandler
-
supportsLimit
public 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.
-
forceLimitUsage
public boolean forceLimitUsage()Description copied from class:AbstractLimitHandler
Generally, if there is no limit applied to a Hibernate query we do not apply any limits to the SQL query. This option forces that the limit be written to the SQL query.- Overrides:
forceLimitUsage
in classAbstractLimitHandler
- Returns:
- true to force limit into SQL query even if none specified in Hibernate query; false otherwise.
-
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
-