public class NoopLimitHandler extends AbstractLimitHandler
Handler not supporting query LIMIT clause. JDBC API is used to set maximum number of returned rows.
Modifier and Type | Field and Description |
---|---|
static NoopLimitHandler |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
int |
bindLimitParametersAtEndOfQuery(RowSelection selection,
PreparedStatement statement,
int index)
Bind parameter values needed by the LIMIT clause after original SELECT statement.
|
int |
bindLimitParametersAtStartOfQuery(RowSelection selection,
PreparedStatement statement,
int index)
Bind parameter values needed by the LIMIT clause before original SELECT statement.
|
String |
processSql(String sql,
RowSelection selection)
Return processed SQL query.
|
void |
setMaxRows(RowSelection selection,
PreparedStatement statement)
Use JDBC API to limit the number of rows returned by the SQL query.
|
bindLimitParameters, bindLimitParametersFirst, bindLimitParametersInReverseOrder, convertToFirstRowValue, forceLimitUsage, getMaxOrLimit, supportsLimit, supportsLimitOffset, supportsVariableLimit, useMaxForLimit
public static final NoopLimitHandler INSTANCE
public String processSql(String sql, RowSelection selection)
LimitHandler
Return processed SQL query.
processSql
in interface LimitHandler
processSql
in class AbstractLimitHandler
sql
- the SQL query to process.selection
- the selection criteria for rows.public int bindLimitParametersAtStartOfQuery(RowSelection selection, PreparedStatement statement, int index)
LimitHandler
Bind parameter values needed by the LIMIT clause before original SELECT statement.
bindLimitParametersAtStartOfQuery
in interface LimitHandler
bindLimitParametersAtStartOfQuery
in class AbstractLimitHandler
selection
- the selection criteria for rows.statement
- Statement to which to bind limit parameter values.index
- Index from which to start binding.public int bindLimitParametersAtEndOfQuery(RowSelection selection, PreparedStatement statement, int index)
LimitHandler
Bind parameter values needed by the LIMIT clause after original SELECT statement.
bindLimitParametersAtEndOfQuery
in interface LimitHandler
bindLimitParametersAtEndOfQuery
in class AbstractLimitHandler
selection
- the selection criteria for rows.statement
- Statement to which to bind limit parameter values.index
- Index from which to start binding.public void setMaxRows(RowSelection selection, PreparedStatement statement) throws SQLException
LimitHandler
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.
setMaxRows
in interface LimitHandler
setMaxRows
in class AbstractLimitHandler
selection
- the selection criteria for rows.statement
- Statement which number of returned rows shall be limited.SQLException
- Indicates problems while limiting maximum rows returned.Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.