We use cookies to serve our customers and website visitors in the best possible way. Cookies are used for the proper functioning of the website and for improving the user experience, monitoring visitor traffic and marketing purposes. By continuing to browse the site, you agree to our use of cookies. You can read more about cookies here.
com.vaadin.data.util.sqlcontainer.query.generator.
Interface SQLGenerator
All Superinterfaces:
All Known Implementing Classes:
- extends Serializable
public interface SQLGenerator
The SQLGenerator interface is meant to be implemented for each different SQL syntax that is to be supported. By default there are implementations for HSQLDB, MySQL, PostgreSQL, MSSQL and Oracle syntaxes.
Author:
Jonatan Kronqvist / Vaadin Ltd
Method Summary | |
---|---|
StatementHelper |
generateDeleteQuery(String tableName,
List<String> primaryKeyColumns,
String versionColumn,
RowItem item)
Generates a DELETE query for deleting data related to the given RowItem from the database. |
StatementHelper |
generateInsertQuery(String tableName,
RowItem item)
Generates an INSERT query for inserting a new row with the provided values. |
StatementHelper |
generateSelectQuery(String tableName,
List<Container.Filter> filters,
List<OrderBy> orderBys,
int offset,
int pagelength,
String toSelect)
Generates a SELECT query with the provided parameters. |
StatementHelper |
generateUpdateQuery(String tableName,
RowItem item)
Generates an UPDATE query with the provided parameters. |
Method Detail |
---|
generateSelectQuery
StatementHelper generateSelectQuery(String tableName,
List<Container.Filter> filters,
List<OrderBy> orderBys,
int offset,
int pagelength,
String toSelect)
- Parameters:
tableName
- Name of the table queriedfilters
- The filters, converted into a WHERE clauseorderBys
- The the ordering conditions, converted into an ORDER BY clauseoffset
- The offset of the first row to be includedpagelength
- The number of rows to be returned when the query executestoSelect
- String containing what to select, e.g. "*", "COUNT(*)"- Returns:
- StatementHelper instance containing the query string for a PreparedStatement and the values required for the parameters
Generates a SELECT query with the provided parameters. Uses default filtering mode (INCLUSIVE).
generateUpdateQuery
StatementHelper generateUpdateQuery(String tableName,
RowItem item)
- Parameters:
tableName
- Name of the table querieditem
- RowItem containing the updated values update.- Returns:
- StatementHelper instance containing the query string for a PreparedStatement and the values required for the parameters
Generates an UPDATE query with the provided parameters.
generateInsertQuery
StatementHelper generateInsertQuery(String tableName,
RowItem item)
- Parameters:
tableName
- Name of the table querieditem
- New RowItem to be inserted into the database.- Returns:
- StatementHelper instance containing the query string for a PreparedStatement and the values required for the parameters
Generates an INSERT query for inserting a new row with the provided values.
generateDeleteQuery
StatementHelper generateDeleteQuery(String tableName,
List<String> primaryKeyColumns,
String versionColumn,
RowItem item)
- Parameters:
tableName
- Name of the table queriedprimaryKeyColumns
- the names of the columns holding the primary key. Usually just one column, but might be several.versionColumn
- the column containing the version number of the row, null if versioning (optimistic locking) not enabled.item
- Item to be deleted from the database- Returns:
- StatementHelper instance containing the query string for a PreparedStatement and the values required for the parameters
Generates a DELETE query for deleting data related to the given RowItem from the database.