Interface QueryDelegate
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
FreeformQuery
,TableQuery
@Deprecated public interface QueryDelegate extends Serializable
Deprecated.As of 8.0, no replacement available.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
QueryDelegate.RowIdChangeEvent
Deprecated.static interface
QueryDelegate.RowIdChangeListener
Deprecated.static interface
QueryDelegate.RowIdChangeNotifier
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
beginTransaction()
Deprecated.Starts a new database transaction.void
commit()
Deprecated.Commits a transaction.boolean
containsRowWithKey(Object... keys)
Deprecated.Performs a query to find out whether the SQL table contains a row with the given set of primary keys.int
getCount()
Deprecated.Generates and executes a query to determine the current row count from the DB.List<String>
getPrimaryKeyColumns()
Deprecated.Returns a list of primary key column names.ResultSet
getResults(int offset, int pagelength)
Deprecated.Executes a paged SQL query and returns the ResultSet.boolean
implementationRespectsPagingLimits()
Deprecated.Allows the SQLContainer implementation to check whether the QueryDelegate implementation implements paging in the getResults method.boolean
removeRow(RowItem row)
Deprecated.Removes the given RowItem from the database.void
rollback()
Deprecated.Rolls a transaction back.void
setFilters(List<Container.Filter> filters)
Deprecated.Sets the filters to apply when performing the SQL query.void
setOrderBy(List<OrderBy> orderBys)
Deprecated.Sets the order in which to retrieve rows from the database.int
storeRow(RowItem row)
Deprecated.Stores a row in the database.
-
-
-
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 loadpagelength
- 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)
-
setFilters
void setFilters(List<Container.Filter> filters) throws UnsupportedOperationException
Deprecated.Sets the filters to apply when performing the SQL query. These are translated into a WHERE clause. Default filtering mode will be used.- Parameters:
filters
- The filters to apply.- Throws:
UnsupportedOperationException
- if the implementation doesn't support filtering.
-
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
-
removeRow
boolean removeRow(RowItem row) throws UnsupportedOperationException, SQLException
Deprecated.Removes the given RowItem from the database.- Parameters:
row
- RowItem to be removed- Returns:
- true on success
- Throws:
UnsupportedOperationException
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
-
-