接口 LimitHandler
-
- 所有已知实现类:
AbstractLimitHandler,CUBRIDLimitHandler,FirstLimitHandler,Informix10LimitHandler,LegacyFirstLimitHandler,LegacyLimitHandler,NoopLimitHandler,SQL2008StandardLimitHandler,SQLServer2005LimitHandler,SQLServer2012LimitHandler,SybaseASE157LimitHandler,TopLimitHandler
public interface LimitHandlerContract defining dialect-specific LIMIT clause handling. Typically implementers might consider extendingAbstractLimitHandlerclass.- 作者:
- Lukasz Antoniak (lukasz dot antoniak at gmail dot com)
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 intbindLimitParametersAtEndOfQuery(RowSelection selection, PreparedStatement statement, int index)Bind parameter values needed by the LIMIT clause after original SELECT statement.intbindLimitParametersAtStartOfQuery(RowSelection selection, PreparedStatement statement, int index)Bind parameter values needed by the LIMIT clause before original SELECT statement.StringprocessSql(String sql, RowSelection selection)Return processed SQL query.voidsetMaxRows(RowSelection selection, PreparedStatement statement)Use JDBC API to limit the number of rows returned by the SQL query.booleansupportsLimit()Does this handler support some form of limiting query results via a SQL clause?booleansupportsLimitOffset()Does this handler's LIMIT support (if any) additionally support specifying an offset?
-
-
-
方法详细资料
-
supportsLimit
boolean supportsLimit()
Does this handler support some form of limiting query results via a SQL clause?- 返回:
- True if this handler supports some form of LIMIT.
-
supportsLimitOffset
boolean supportsLimitOffset()
Does this handler's LIMIT support (if any) additionally support specifying an offset?- 返回:
- True if the handler supports an offset within the limit support.
-
processSql
String processSql(String sql, RowSelection selection)
Return processed SQL query.- 参数:
sql- the SQL query to process.selection- the selection criteria for rows.- 返回:
- Query statement with LIMIT clause applied.
-
bindLimitParametersAtStartOfQuery
int bindLimitParametersAtStartOfQuery(RowSelection selection, PreparedStatement statement, int index) throws SQLException
Bind parameter values needed by the LIMIT clause before original SELECT statement.- 参数:
selection- the selection criteria for rows.statement- Statement to which to bind limit parameter values.index- Index from which to start binding.- 返回:
- The number of parameter values bound.
- 抛出:
SQLException- Indicates problems binding parameter values.
-
bindLimitParametersAtEndOfQuery
int bindLimitParametersAtEndOfQuery(RowSelection selection, PreparedStatement statement, int index) throws SQLException
Bind parameter values needed by the LIMIT clause after original SELECT statement.- 参数:
selection- the selection criteria for rows.statement- Statement to which to bind limit parameter values.index- Index from which to start binding.- 返回:
- The number of parameter values bound.
- 抛出:
SQLException- Indicates problems binding parameter values.
-
setMaxRows
void setMaxRows(RowSelection selection, PreparedStatement statement) throws SQLException
Use JDBC API to limit the number of rows returned by the SQL query. Typically handlers that do not support LIMIT clause should implement this method.- 参数:
selection- the selection criteria for rows.statement- Statement which number of returned rows shall be limited.- 抛出:
SQLException- Indicates problems while limiting maximum rows returned.
-
-