Class DefaultSQLGenerator
- java.lang.Object
-
- com.vaadin.v7.data.util.sqlcontainer.query.generator.DefaultSQLGenerator
-
- All Implemented Interfaces:
SQLGenerator,Serializable
- Direct Known Subclasses:
MSSQLGenerator,OracleGenerator
@Deprecated public class DefaultSQLGenerator extends Object implements SQLGenerator
Deprecated.As of 8.0, no replacement available.Generates generic SQL that is supported by HSQLDB, MySQL and PostgreSQL.- Author:
- Jonatan Kronqvist / Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultSQLGenerator()Deprecated.DefaultSQLGenerator(Class<? extends StatementHelper> statementHelperClazz)Deprecated.Create a new DefaultSqlGenerator instance that uses the given implementation ofStatementHelper.DefaultSQLGenerator(String quoteStart, String quoteEnd)Deprecated.Construct a DefaultSQLGenerator with the specified identifiers for start and end of quoted strings.DefaultSQLGenerator(String quoteStart, String quoteEnd, Class<? extends StatementHelper> statementHelperClazz)Deprecated.Same asDefaultSQLGenerator(String, String)but with support for customStatementHelperimplementation.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected Map<String,Object>generateColumnToValueMap(RowItem item)Deprecated.StatementHelpergenerateDeleteQuery(String tableName, List<String> primaryKeyColumns, String versionColumn, RowItem item)Deprecated.Generates a DELETE query for deleting data related to the given RowItem from the database.StatementHelpergenerateInsertQuery(String tableName, RowItem item)Deprecated.Generates an INSERT query for inserting a new row with the provided values.protected StringBuffergenerateLimits(StringBuffer sb, int offset, int pagelength)Deprecated.Generates the LIMIT and OFFSET clause.protected StringBuffergenerateOrderBy(StringBuffer sb, OrderBy o, boolean firstOrderBy)Deprecated.Generates sorting rules as an ORDER BY -clause.protected Map<String,Object>generateRowIdentifiers(RowItem item)Deprecated.StatementHelpergenerateSelectQuery(String tableName, List<Container.Filter> filters, List<OrderBy> orderBys, int offset, int pagelength, String toSelect)Deprecated.Generates a SELECT query with the provided parameters.StatementHelpergenerateUpdateQuery(String tableName, RowItem item)Deprecated.Generates an UPDATE query with the provided parameters.protected StatementHelpergetStatementHelper()Deprecated.Returns the statement helper for the generator.
-
-
-
Constructor Detail
-
DefaultSQLGenerator
public DefaultSQLGenerator()
Deprecated.
-
DefaultSQLGenerator
public DefaultSQLGenerator(Class<? extends StatementHelper> statementHelperClazz)
Deprecated.Create a new DefaultSqlGenerator instance that uses the given implementation ofStatementHelper.- Parameters:
statementHelperClazz- the statement helper implementation type
-
DefaultSQLGenerator
public DefaultSQLGenerator(String quoteStart, String quoteEnd)
Deprecated.Construct a DefaultSQLGenerator with the specified identifiers for start and end of quoted strings. The identifiers may be different depending on the database engine and it's settings.- Parameters:
quoteStart- the identifier (character) denoting the start of a quoted stringquoteEnd- the identifier (character) denoting the end of a quoted string
-
DefaultSQLGenerator
public DefaultSQLGenerator(String quoteStart, String quoteEnd, Class<? extends StatementHelper> statementHelperClazz)
Deprecated.Same asDefaultSQLGenerator(String, String)but with support for customStatementHelperimplementation.- Parameters:
quoteStart-quoteEnd-statementHelperClazz-
-
-
Method Detail
-
generateSelectQuery
public StatementHelper generateSelectQuery(String tableName, List<Container.Filter> filters, List<OrderBy> orderBys, int offset, int pagelength, String toSelect)
Deprecated.Description copied from interface:SQLGeneratorGenerates a SELECT query with the provided parameters. Uses default filtering mode (INCLUSIVE).- Specified by:
generateSelectQueryin interfaceSQLGenerator- 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
-
generateUpdateQuery
public StatementHelper generateUpdateQuery(String tableName, RowItem item)
Deprecated.Description copied from interface:SQLGeneratorGenerates an UPDATE query with the provided parameters.- Specified by:
generateUpdateQueryin interfaceSQLGenerator- 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
-
generateInsertQuery
public StatementHelper generateInsertQuery(String tableName, RowItem item)
Deprecated.Description copied from interface:SQLGeneratorGenerates an INSERT query for inserting a new row with the provided values.- Specified by:
generateInsertQueryin interfaceSQLGenerator- 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
-
generateDeleteQuery
public StatementHelper generateDeleteQuery(String tableName, List<String> primaryKeyColumns, String versionColumn, RowItem item)
Deprecated.Description copied from interface:SQLGeneratorGenerates a DELETE query for deleting data related to the given RowItem from the database.- Specified by:
generateDeleteQueryin interfaceSQLGenerator- 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
-
generateOrderBy
protected StringBuffer generateOrderBy(StringBuffer sb, OrderBy o, boolean firstOrderBy)
Deprecated.Generates sorting rules as an ORDER BY -clause.- Parameters:
sb- StringBuffer to which the clause is appended.o- OrderBy object to be added into the sb.firstOrderBy- If true, this is the first OrderBy.- Returns:
-
generateLimits
protected StringBuffer generateLimits(StringBuffer sb, int offset, int pagelength)
Deprecated.Generates the LIMIT and OFFSET clause.- Parameters:
sb- StringBuffer to which the clause is appended.offset- Value for offset.pagelength- Value for pagelength.- Returns:
- StringBuffer with LIMIT and OFFSET clause added.
-
generateColumnToValueMap
protected Map<String,Object> generateColumnToValueMap(RowItem item)
Deprecated.
-
generateRowIdentifiers
protected Map<String,Object> generateRowIdentifiers(RowItem item)
Deprecated.
-
getStatementHelper
protected StatementHelper getStatementHelper()
Deprecated.Returns the statement helper for the generator. Override this to handle platform specific data types.- Returns:
- a new instance of the statement helper
- See Also:
- ticket #9148
-
-