Interface QueryDelegate

    • Method Detail

      • getCount

        int getCount()
              throws SQLException
        Deprecated.
        Generates and executes a query to determine the current row count from the DB. Row count will be fetched using filters that are currently set to the QueryDelegate.
        Returns:
        row count
        Throws:
        SQLException
      • getResults

        ResultSet getResults​(int offset,
                             int pagelength)
                      throws SQLException
        Deprecated.
        Executes a paged SQL query and returns the ResultSet. The query is defined through implementations of this QueryDelegate interface.
        Parameters:
        offset - the first item of the page to load
        pagelength - the length of the page to load
        Returns:
        a ResultSet containing the rows of the page
        Throws:
        SQLException - if the database access fails.
      • implementationRespectsPagingLimits

        boolean implementationRespectsPagingLimits()
        Deprecated.
        Allows the SQLContainer implementation to check whether the QueryDelegate implementation implements paging in the getResults method.
        Returns:
        true if the delegate implements paging
        See Also:
        getResults(int, int)
      • setOrderBy

        void setOrderBy​(List<OrderBy> orderBys)
                 throws UnsupportedOperationException
        Deprecated.
        Sets the order in which to retrieve rows from the database. The result can be ordered by zero or more columns and each column can be in ascending or descending order. These are translated into an ORDER BY clause in the SQL query.
        Parameters:
        orderBys - A list of the OrderBy conditions.
        Throws:
        UnsupportedOperationException - if the implementation doesn't support ordering.
      • storeRow

        int storeRow​(RowItem row)
              throws UnsupportedOperationException,
                     SQLException
        Deprecated.
        Stores a row in the database. The implementation of this interface decides how to identify whether to store a new row or update an existing one.
        Parameters:
        row - The row to be stored or updated.
        Returns:
        the number of affected rows in the database table
        Throws:
        UnsupportedOperationException - if the implementation is read only.
        SQLException
      • beginTransaction

        void beginTransaction()
                       throws SQLException
        Deprecated.
        Starts a new database transaction. Used when storing multiple changes. Note that if a transaction is already open, it will be rolled back when a new transaction is started.
        Throws:
        SQLException - if the database access fails.
      • commit

        void commit()
             throws SQLException
        Deprecated.
        Commits a transaction. If a transaction is not open nothing should happen.
        Throws:
        SQLException - if the database access fails.
      • rollback

        void rollback()
               throws SQLException
        Deprecated.
        Rolls a transaction back. If a transaction is not open nothing should happen.
        Throws:
        SQLException - if the database access fails.
      • getPrimaryKeyColumns

        List<String> getPrimaryKeyColumns()
        Deprecated.
        Returns a list of primary key column names. The list is either fetched from the database (TableQuery) or given as an argument depending on implementation.
        Returns:
      • containsRowWithKey

        boolean containsRowWithKey​(Object... keys)
                            throws SQLException
        Deprecated.
        Performs a query to find out whether the SQL table contains a row with the given set of primary keys.
        Parameters:
        keys - the primary keys
        Returns:
        true if the SQL table contains a row with the provided keys
        Throws:
        SQLException