Top Description Fields Constructors Methods
org.hibernate.dialect.pagination

public Class Oracle12LimitHandler

extends AbstractLimitHandler
Class Inheritance
Imports
java.util.Locale, org.hibernate.LockMode, .LockOptions, org.hibernate.engine.spi.QueryParameters, .RowSelection

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.
Author
Gavin King

Field Summary

Modifier and TypeField and Description
public boolean
public static final Oracle12LimitHandler
public boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
bindLimitParametersInReverseOrder()

Overrides org.hibernate.dialect.pagination.AbstractLimitHandler.bindLimitParametersInReverseOrder.

ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit.
private int
public String
processSql(String
the SQL query to process.
sql
,
RowSelection
the selection criteria for rows.
selection
)

Overrides org.hibernate.dialect.pagination.AbstractLimitHandler.processSql.

Implements org.hibernate.dialect.pagination.LimitHandler.processSql.

Return processed SQL query.
public String
processSql(String
the SQL query to process.
sql
,
QueryParameters
the queryParameters.
queryParameters
)

Overrides default org.hibernate.dialect.pagination.LimitHandler.processSql.

Return processed SQL query.
private String
processSql(String sql, int forUpdateIndex, boolean hasFirstRow)

private String
processSqlOffsetFetch(String sql, boolean hasFirstRow)

public final boolean
supportsLimit()

Overrides org.hibernate.dialect.pagination.AbstractLimitHandler.supportsLimit.

Implements org.hibernate.dialect.pagination.LimitHandler.supportsLimit.

Does this handler support some form of limiting query results via a SQL clause?
public boolean
useMaxForLimit()

Overrides org.hibernate.dialect.pagination.AbstractLimitHandler.useMaxForLimit.

Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows?
Inherited from org.hibernate.dialect.pagination.AbstractLimitHandler:
bindLimitParametersbindLimitParametersAtEndOfQuerybindLimitParametersAtStartOfQuerybindLimitParametersFirstconvertToFirstRowValueforceLimitUsagegetMaxOrLimitsetMaxRowssupportsLimitOffsetsupportsVariableLimit

Field Detail

bindLimitParametersInReverseOrderback to summary
public boolean bindLimitParametersInReverseOrder
INSTANCEback to summary
public static final Oracle12LimitHandler INSTANCE
useMaxForLimitback to summary
public boolean useMaxForLimit

Constructor Detail

Oracle12LimitHandlerback to summary
pack-priv Oracle12LimitHandler()

Method Detail

bindLimitParametersInReverseOrderback to summary
public boolean bindLimitParametersInReverseOrder()

Overrides org.hibernate.dialect.pagination.AbstractLimitHandler.bindLimitParametersInReverseOrder.

Doc from org.hibernate.dialect.pagination.AbstractLimitHandler.bindLimitParametersInReverseOrder.

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?

Returns:boolean

true if the correct order is limit, offset

Annotations
@Override
getForUpdateIndexback to summary
private int getForUpdateIndex(String sql)
processSqlback to summary
public String processSql(String sql, RowSelection selection)

Overrides org.hibernate.dialect.pagination.AbstractLimitHandler.processSql.

Implements org.hibernate.dialect.pagination.LimitHandler.processSql.

Doc from org.hibernate.dialect.pagination.LimitHandler.processSql.

Return processed SQL query.

Parameters
sql:String

the SQL query to process.

selection:RowSelection

the selection criteria for rows.

Returns:String

Query statement with LIMIT clause applied.

Annotations
@Override
processSqlback to summary
public String processSql(String sql, QueryParameters queryParameters)

Overrides default org.hibernate.dialect.pagination.LimitHandler.processSql.

Doc from org.hibernate.dialect.pagination.LimitHandler.processSql.

Return processed SQL query.

Parameters
sql:String

the SQL query to process.

queryParameters:QueryParameters

the queryParameters.

Returns:String

Query statement with LIMIT clause applied.

Annotations
@Override
processSqlback to summary
private String processSql(String sql, int forUpdateIndex, boolean hasFirstRow)
processSqlOffsetFetchback to summary
private String processSqlOffsetFetch(String sql, boolean hasFirstRow)
supportsLimitback to summary
public final boolean supportsLimit()

Overrides org.hibernate.dialect.pagination.AbstractLimitHandler.supportsLimit.

Implements org.hibernate.dialect.pagination.LimitHandler.supportsLimit.

Doc from org.hibernate.dialect.pagination.LimitHandler.supportsLimit.

Does this handler support some form of limiting query results via a SQL clause?

Returns:boolean

True if this handler supports some form of LIMIT.

Annotations
@Override
useMaxForLimitback to summary
public boolean useMaxForLimit()

Overrides org.hibernate.dialect.pagination.AbstractLimitHandler.useMaxForLimit.

Doc from org.hibernate.dialect.pagination.AbstractLimitHandler.useMaxForLimit.

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?

Returns:boolean

True if limit is relative from offset; false otherwise.

Annotations
@Override