public class LegacyLimitHandler extends AbstractLimitHandler
selection, sql
Constructor and Description |
---|
LegacyLimitHandler(Dialect dialect,
String sql,
RowSelection selection)
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 |
getProcessedSql()
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, String sql, RowSelection selection)
dialect
- The dialectsql
- The sqlselection
- The row selectionpublic 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.AbstractLimitHandler(String, 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 getProcessedSql()
LimitHandler
getProcessedSql
in interface LimitHandler
getProcessedSql
in class AbstractLimitHandler
Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.