Interface FreeformStatementDelegate

  • All Superinterfaces:
    FreeformQueryDelegate, Serializable

    @Deprecated
    public interface FreeformStatementDelegate
    extends FreeformQueryDelegate
    Deprecated.
    As of 8.0, no replacement available.
    FreeformStatementDelegate is an extension to FreeformQueryDelegate that provides definitions for methods that produce StatementHelper objects instead of basic query strings. This allows the FreeformQuery query delegate to use PreparedStatements instead of regular Statement when accessing the database. Due to the injection protection and other benefits of prepared statements, it is advisable to implement this interface instead of the FreeformQueryDelegate whenever possible.
    • Method Detail

      • getQueryStatement

        StatementHelper getQueryStatement​(int offset,
                                          int limit)
                                   throws UnsupportedOperationException
        Deprecated.
        Should return a new instance of StatementHelper that contains the query string and parameter values required to create a PreparedStatement. This method is responsible for gluing together the select query from the filters and the order by conditions if these are supported.
        Parameters:
        offset - the first record (row) to fetch.
        limit - the limit of records (rows) to fetch. 0 means all records starting from offset.
        Throws:
        UnsupportedOperationException
      • getCountStatement

        StatementHelper getCountStatement()
                                   throws UnsupportedOperationException
        Deprecated.
        Should return a new instance of StatementHelper that contains the query string and parameter values required to create a PreparedStatement that will fetch the row count from the DB. Row count should be fetched using filters that are currently set to the QueryDelegate.
        Throws:
        UnsupportedOperationException
      • getContainsRowQueryStatement

        StatementHelper getContainsRowQueryStatement​(Object... keys)
                                              throws UnsupportedOperationException
        Deprecated.
        Should return a new instance of StatementHelper that contains the query string and parameter values required to create a PreparedStatement used by the FreeformQuery.containsRowWithKeys() method. This is useful for cases when the default logic in said method is not enough to support more complex free form queries.
        Parameters:
        keys - the values of the primary keys
        Throws:
        UnsupportedOperationException - to use the default logic in FreeformQuery