Class 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.
    • 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 interface LimitHandler
        Overrides:
        processSql in class AbstractLimitHandler
        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 interface LimitHandler
        Overrides:
        bindLimitParametersAtStartOfQuery in class AbstractLimitHandler
        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 interface LimitHandler
        Overrides:
        bindLimitParametersAtEndOfQuery in class AbstractLimitHandler
        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 interface LimitHandler
        Overrides:
        setMaxRows in class AbstractLimitHandler
        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.