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
ALimitHandlerfor databases which support the ANSI SQL standard syntaxFETCH FIRST m ROWS ONLYandOFFSET n ROWS FETCH NEXT m ROWS ONLY.
-
-
Field Summary
Fields Modifier and Type Field Description booleanbindLimitParametersInReverseOrderstatic Oracle12LimitHandlerINSTANCEbooleanuseMaxForLimit
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanbindLimitParametersInReverseOrder()ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit.StringprocessSql(String sql, QueryParameters queryParameters)Return processed SQL query.StringprocessSql(String sql, RowSelection selection)Return processed SQL query.booleansupportsLimit()Does this handler support some form of limiting query results via a SQL clause?booleanuseMaxForLimit()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 String processSql(String sql, RowSelection selection)
Description copied from interface:LimitHandlerReturn processed SQL query.- Specified by:
processSqlin interfaceLimitHandler- Overrides:
processSqlin classAbstractLimitHandler- Parameters:
sql- the SQL query to process.selection- the selection criteria for rows.- Returns:
- Query statement with LIMIT clause applied.
-
processSql
public String processSql(String sql, QueryParameters queryParameters)
Description copied from interface:LimitHandlerReturn 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:LimitHandlerDoes this handler support some form of limiting query results via a SQL clause?- Specified by:
supportsLimitin interfaceLimitHandler- Overrides:
supportsLimitin classAbstractLimitHandler- Returns:
- True if this handler supports some form of LIMIT.
-
bindLimitParametersInReverseOrder
public boolean bindLimitParametersInReverseOrder()
Description copied from class:AbstractLimitHandlerANSI 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:
bindLimitParametersInReverseOrderin classAbstractLimitHandler- Returns:
- true if the correct order is limit, offset
-
useMaxForLimit
public boolean useMaxForLimit()
Description copied from class:AbstractLimitHandlerDoes 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:
useMaxForLimitin classAbstractLimitHandler- Returns:
- True if limit is relative from offset; false otherwise.
-
-