com.vaadin.data.util.sqlcontainer.query.
Interface FreeformQueryDelegate
All Superinterfaces:
All Known Subinterfaces:
- extends Serializable
public interface FreeformQueryDelegate
Method Summary | |
---|---|
String |
getContainsRowQueryString(Object... keys)
Deprecated. Implement FreeformStatementDelegate instead of
FreeformQueryDelegate |
String |
getCountQuery()
Deprecated. Implement FreeformStatementDelegate instead of
FreeformQueryDelegate |
String |
getQueryString(int offset,
int limit)
Deprecated. Implement FreeformStatementDelegate instead of
FreeformQueryDelegate |
boolean |
removeRow(Connection conn,
RowItem row)
Removes the given RowItem from the database. |
void |
setFilters(List<Container.Filter> filters)
Sets the filters to apply when performing the SQL query. |
void |
setOrderBy(List<OrderBy> orderBys)
Sets the order in which to retrieve rows from the database. |
int |
storeRow(Connection conn,
RowItem row)
Stores a row in the database. |
Method Detail |
---|
getQueryString
@Deprecated
String getQueryString(int offset,
int limit)
throws UnsupportedOperationException
- Parameters:
offset
- the first record (row) to fetch.pagelength
- the number of records (rows) to fetch. 0 means all records starting from offset.- Throws:
UnsupportedOperationException
Deprecated. Implement FreeformStatementDelegate
instead of
FreeformQueryDelegate
Should return the SQL query string to be performed. This method is responsible for gluing together the select query from the filters and the order by conditions if these are supported.
getCountQuery
@Deprecated
String getCountQuery()
throws UnsupportedOperationException
- Returns:
- row count
- Throws:
SQLException
UnsupportedOperationException
Deprecated. Implement FreeformStatementDelegate
instead of
FreeformQueryDelegate
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.
setFilters
void setFilters(List<Container.Filter> filters)
throws UnsupportedOperationException
- Parameters:
filters
- The filters to apply.- Throws:
UnsupportedOperationException
- if the implementation doesn't support filtering.
Sets the filters to apply when performing the SQL query. These are translated into a WHERE clause. Default filtering mode will be used.
setOrderBy
void setOrderBy(List<OrderBy> orderBys)
throws UnsupportedOperationException
- Parameters:
orderBys
- A list of the OrderBy conditions.- Throws:
UnsupportedOperationException
- if the implementation doesn't support ordering.
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.
storeRow
int storeRow(Connection conn,
RowItem row)
throws UnsupportedOperationException,
SQLException
- Parameters:
conn
- the JDBC connection to userow
- RowItem to be stored or updated.- Throws:
UnsupportedOperationException
- if the implementation is read only.SQLException
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.
removeRow
boolean removeRow(Connection conn,
RowItem row)
throws UnsupportedOperationException,
SQLException
- Parameters:
conn
- the JDBC connection to userow
- RowItem to be removed- Returns:
- true on success
- Throws:
UnsupportedOperationException
SQLException
Removes the given RowItem from the database.
getContainsRowQueryString
@Deprecated
String getContainsRowQueryString(Object... keys)
throws UnsupportedOperationException
- Parameters:
keys
- the values of the primary keys- Throws:
UnsupportedOperationException
- to use the default logic in FreeformQuery
Deprecated. Implement FreeformStatementDelegate
instead of
FreeformQueryDelegate
Generates an SQL Query string that allows the user of the FreeformQuery class to customize the query string used by the FreeformQuery.containsRowWithKeys() method. This is useful for cases when the logic in the containsRowWithKeys method is not enough to support more complex free form queries.