Package org.hibernate.dialect.pagination
Class NoopLimitHandler
- java.lang.Object
-
- org.hibernate.dialect.pagination.AbstractLimitHandler
-
- org.hibernate.dialect.pagination.NoopLimitHandler
-
- All Implemented Interfaces:
LimitHandler
public class NoopLimitHandler extends AbstractLimitHandler
Handler not supporting query LIMIT clause. JDBC API is used to set maximum number of returned rows.
-
-
Field Summary
Fields Modifier and Type Field Description static NoopLimitHandler
INSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
bindLimitParametersAtEndOfQuery(RowSelection selection, java.sql.PreparedStatement statement, int index)
Bind parameter values needed by the LIMIT clause after original SELECT statement.int
bindLimitParametersAtStartOfQuery(RowSelection selection, java.sql.PreparedStatement statement, int index)
Bind parameter values needed by the LIMIT clause before original SELECT statement.java.lang.String
processSql(java.lang.String sql, RowSelection selection)
Return processed SQL query.void
setMaxRows(RowSelection selection, java.sql.PreparedStatement statement)
Use JDBC API to limit the number of rows returned by the SQL query.-
Methods inherited from class org.hibernate.dialect.pagination.AbstractLimitHandler
bindLimitParameters, bindLimitParametersFirst, bindLimitParametersInReverseOrder, convertToFirstRowValue, forceLimitUsage, getMaxOrLimit, supportsLimit, supportsLimitOffset, supportsVariableLimit, useMaxForLimit
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.dialect.pagination.LimitHandler
processSql
-
-
-
-
Field Detail
-
INSTANCE
public static final NoopLimitHandler INSTANCE
-
-
Method Detail
-
processSql
public java.lang.String processSql(java.lang.String sql, RowSelection selection)
Description copied from interface:LimitHandler
Return processed SQL query.- Specified by:
processSql
in interfaceLimitHandler
- Overrides:
processSql
in classAbstractLimitHandler
- Parameters:
sql
- the SQL query to process.selection
- the selection criteria for rows.- Returns:
- Query statement with LIMIT clause applied.
-
bindLimitParametersAtStartOfQuery
public int bindLimitParametersAtStartOfQuery(RowSelection selection, java.sql.PreparedStatement statement, int index)
Description copied from interface:LimitHandler
Bind parameter values needed by the LIMIT clause before original SELECT statement.- Specified by:
bindLimitParametersAtStartOfQuery
in interfaceLimitHandler
- Overrides:
bindLimitParametersAtStartOfQuery
in classAbstractLimitHandler
- Parameters:
selection
- the selection criteria for rows.statement
- Statement to which to bind limit parameter values.index
- Index from which to start binding.- Returns:
- The number of parameter values bound.
-
bindLimitParametersAtEndOfQuery
public int bindLimitParametersAtEndOfQuery(RowSelection selection, java.sql.PreparedStatement statement, int index)
Description copied from interface:LimitHandler
Bind parameter values needed by the LIMIT clause after original SELECT statement.- Specified by:
bindLimitParametersAtEndOfQuery
in interfaceLimitHandler
- Overrides:
bindLimitParametersAtEndOfQuery
in classAbstractLimitHandler
- Parameters:
selection
- the selection criteria for rows.statement
- Statement to which to bind limit parameter values.index
- Index from which to start binding.- Returns:
- The number of parameter values bound.
-
setMaxRows
public void setMaxRows(RowSelection selection, java.sql.PreparedStatement statement) throws java.sql.SQLException
Description copied from interface: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.- Specified by:
setMaxRows
in interfaceLimitHandler
- Overrides:
setMaxRows
in classAbstractLimitHandler
- Parameters:
selection
- the selection criteria for rows.statement
- Statement which number of returned rows shall be limited.- Throws:
java.sql.SQLException
- Indicates problems while limiting maximum rows returned.
-
-