public class LegacyLimitHandler extends AbstractLimitHandler
Constructor and Description |
---|
LegacyLimitHandler(Dialect dialect)
Constructs a LegacyLimitHandler
|
Modifier and Type | Method and Description |
---|---|
boolean |
bindLimitParametersFirst()
Does the LIMIT clause come at the start of the
SELECT statement, rather than at the end?
|
boolean |
bindLimitParametersInReverseOrder()
ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit.
|
int |
convertToFirstRowValue(int zeroBasedFirstResult)
Hibernate APIs explicitly state that setFirstResult() should be a zero-based offset.
|
boolean |
forceLimitUsage()
Generally, if there is no limit applied to a Hibernate query we do not apply any limits
to the SQL query.
|
String |
processSql(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 |
supportsLimitOffset()
Does this handler's LIMIT support (if any) additionally
support specifying an offset?
|
boolean |
supportsVariableLimit()
Does this handler support bind variables (i.e., prepared statement
parameters) for its limit/offset?
|
boolean |
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.
|
bindLimitParameters, bindLimitParametersAtEndOfQuery, bindLimitParametersAtStartOfQuery, getMaxOrLimit, setMaxRows
public LegacyLimitHandler(Dialect dialect)
dialect
- The dialectpublic boolean supportsLimit()
LimitHandler
supportsLimit
in interface LimitHandler
supportsLimit
in class AbstractLimitHandler
public boolean supportsLimitOffset()
LimitHandler
supportsLimitOffset
in interface LimitHandler
supportsLimitOffset
in class AbstractLimitHandler
public boolean supportsVariableLimit()
AbstractLimitHandler
supportsVariableLimit
in class AbstractLimitHandler
public boolean bindLimitParametersInReverseOrder()
AbstractLimitHandler
bindLimitParametersInReverseOrder
in class AbstractLimitHandler
public boolean bindLimitParametersFirst()
AbstractLimitHandler
bindLimitParametersFirst
in class AbstractLimitHandler
public boolean useMaxForLimit()
AbstractLimitHandler
useMaxForLimit
in class AbstractLimitHandler
public boolean forceLimitUsage()
AbstractLimitHandler
forceLimitUsage
in class AbstractLimitHandler
public int convertToFirstRowValue(int zeroBasedFirstResult)
AbstractLimitHandler
AbstractLimitHandler.processSql(String, org.hibernate.engine.spi.RowSelection)
is the zero-based offset. Dialects which do not AbstractLimitHandler.supportsVariableLimit()
should take care to perform
any needed first-row-conversion calls prior to injecting the limit values into the SQL string.convertToFirstRowValue
in class AbstractLimitHandler
zeroBasedFirstResult
- The user-supplied, zero-based first row offset.Query.setFirstResult(int)
,
Criteria.setFirstResult(int)
public String processSql(String sql, RowSelection selection)
LimitHandler
processSql
in interface LimitHandler
processSql
in class AbstractLimitHandler
sql
- the SQL query to process.selection
- the selection criteria for rows.Copyright © 2001-2017 Red Hat, Inc. All Rights Reserved.