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 boolean
bindLimitParametersInReverseOrder
static Oracle12LimitHandler
INSTANCE
boolean
useMaxForLimit
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
bindLimitParametersInReverseOrder()
ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit.java.lang.String
processSql(java.lang.String sql, QueryParameters queryParameters)
Return processed SQL query.java.lang.String
processSql(java.lang.String sql, RowSelection selection)
Return processed SQL query.boolean
supportsLimit()
Does this handler support some form of limiting query results via a SQL clause?boolean
useMaxForLimit()
Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows?-
Methods inherited from class org.hibernate.dialect.pagination.AbstractLimitHandler
bindLimitParameters, bindLimitParametersAtEndOfQuery, bindLimitParametersAtStartOfQuery, bindLimitParametersFirst, convertToFirstRowValue, forceLimitUsage, getMaxOrLimit, setMaxRows, supportsLimitOffset, supportsVariableLimit
-
-
-
-
Field Detail
-
bindLimitParametersInReverseOrder
public boolean bindLimitParametersInReverseOrder
-
useMaxForLimit
public boolean useMaxForLimit
-
INSTANCE
public static final Oracle12LimitHandler INSTANCE
-
-
Method Detail
-
processSql
public java.lang.String processSql(java.lang.String sql, RowSelection selection)
Description copied from interface:LimitHandler
Return processed SQL query.- Specified by:
processSql
in interfaceLimitHandler
- Overrides:
processSql
in classAbstractLimitHandler
- Parameters:
sql
- the SQL query to process.selection
- the selection criteria for rows.- Returns:
- Query statement with LIMIT clause applied.
-
processSql
public java.lang.String processSql(java.lang.String sql, QueryParameters queryParameters)
Description copied from interface:LimitHandler
Return processed SQL query.- Parameters:
sql
- the SQL query to process.queryParameters
- the queryParameters.- Returns:
- Query statement with LIMIT clause applied.
-
supportsLimit
public final boolean supportsLimit()
Description copied from interface:LimitHandler
Does this handler support some form of limiting query results via a SQL clause?- Specified by:
supportsLimit
in interfaceLimitHandler
- Overrides:
supportsLimit
in classAbstractLimitHandler
- Returns:
- True if this handler supports some form of LIMIT.
-
bindLimitParametersInReverseOrder
public boolean bindLimitParametersInReverseOrder()
Description copied from class:AbstractLimitHandler
ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, 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, offset
-
useMaxForLimit
public boolean useMaxForLimit()
Description copied from class:AbstractLimitHandler
Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows? This is easiest understood via an example. Consider you have a table with 20 rows, but you only want to retrieve rows number 11 through 20. Generally, a limit with offset would say that the offset = 11 and the limit = 10 (we only want 10 rows at a time); this is specifying the total number of returned rows. Some dialects require that we instead specify offset = 11 and limit = 20, where 20 is the "last" row we want relative to offset (i.e. total number of rows = 20 - 11 = 9) So essentially, is limit relative from offset? Or is limit absolute?- Overrides:
useMaxForLimit
in classAbstractLimitHandler
- Returns:
- True if limit is relative from offset; false otherwise.
-
-