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 NoopLimitHandlerINSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intbindLimitParametersAtEndOfQuery(RowSelection selection, java.sql.PreparedStatement statement, int index)Bind parameter values needed by the LIMIT clause after original SELECT statement.intbindLimitParametersAtStartOfQuery(RowSelection selection, java.sql.PreparedStatement statement, int index)Bind parameter values needed by the LIMIT clause before original SELECT statement.java.lang.StringprocessSql(java.lang.String sql, RowSelection selection)Return processed SQL query.voidsetMaxRows(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:LimitHandlerReturn processed SQL query.- Specified by:
processSqlin interfaceLimitHandler- Overrides:
processSqlin 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:LimitHandlerBind parameter values needed by the LIMIT clause before original SELECT statement.- Specified by:
bindLimitParametersAtStartOfQueryin interfaceLimitHandler- Overrides:
bindLimitParametersAtStartOfQueryin 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:LimitHandlerBind parameter values needed by the LIMIT clause after original SELECT statement.- Specified by:
bindLimitParametersAtEndOfQueryin interfaceLimitHandler- Overrides:
bindLimitParametersAtEndOfQueryin 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:LimitHandlerUse 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:
setMaxRowsin interfaceLimitHandler- Overrides:
setMaxRowsin 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.
-
-