org.hibernate.dialect.pagination
Class NoopLimitHandler

java.lang.Object
  extended by org.hibernate.dialect.pagination.AbstractLimitHandler
      extended by 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 inherited from class org.hibernate.dialect.pagination.AbstractLimitHandler
selection, sql
 
Constructor Summary
NoopLimitHandler(String sql, RowSelection selection)
           
 
Method Summary
 int bindLimitParametersAtEndOfQuery(PreparedStatement statement, int index)
          Bind parameter values needed by the LIMIT clause after original SELECT statement.
 int bindLimitParametersAtStartOfQuery(PreparedStatement statement, int index)
          Bind parameter values needed by the LIMIT clause before original SELECT statement.
 String getProcessedSql()
          Return processed SQL query.
 void setMaxRows(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
 

Constructor Detail

NoopLimitHandler

public NoopLimitHandler(String sql,
                        RowSelection selection)
Method Detail

getProcessedSql

public String getProcessedSql()
Description copied from interface: LimitHandler
Return processed SQL query.

Specified by:
getProcessedSql in interface LimitHandler
Overrides:
getProcessedSql in class AbstractLimitHandler
Returns:
Query statement with LIMIT clause applied.

bindLimitParametersAtStartOfQuery

public int bindLimitParametersAtStartOfQuery(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 interface LimitHandler
Overrides:
bindLimitParametersAtStartOfQuery in class AbstractLimitHandler
Parameters:
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(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 interface LimitHandler
Overrides:
bindLimitParametersAtEndOfQuery in class AbstractLimitHandler
Parameters:
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(PreparedStatement statement)
                throws 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 interface LimitHandler
Overrides:
setMaxRows in class AbstractLimitHandler
Parameters:
statement - Statement which number of returned rows shall be limited.
Throws:
SQLException - Indicates problems while limiting maximum rows returned.


Copyright © 2001-2013 Red Hat, Inc. All Rights Reserved.