org.sql.generation.api.grammar.factories
Interface ModificationFactory


public interface ModificationFactory

A factory, which creates SQL syntax elements related to modification statements (INSERT INTO, DELETE FROM, and UPDATE). This factory is obtainable from SQLVendor.

Author:
Stanislav Muhametsin
See Also:
SQLVendor

Method Summary
 ColumnSourceByQuery columnSourceByQuery(ColumnNameList columnNames, QueryExpression query)
          Creates a column source, which uses specified target table column names and query as source columns in INSERT INTO statement.
 ColumnSourceByQuery columnSourceByQuery(QueryExpression query)
           Creates a column source, which uses a query as a source for columns in INSERT INTO statement.
 ColumnSourceByValuesBuilder columnSourceByValues()
          Creates a builder to add values as column sources in INSERT INTO statement.
 TargetTable createTargetTable(TableName tableName)
           Creates new target table to use in modification statements.
 TargetTable createTargetTable(TableName tableName, Boolean isOnly)
          Creates new target table to use in modification statements.
 DeleteBySearchBuilder deleteBySearch()
          Creates builder to create DeleteBySearch statements.
 InsertStatementBuilder insert()
          Creates builder to create InsertStatements.
 SetClause setClause(String updateTarget, UpdateSource updateSource)
          Creates a new set clause for UPDATE statement.
 UpdateBySearchBuilder updateBySearch()
          Creates builder to create UpdateBySearch statements.
 UpdateSourceByExpression updateSourceByExp(ValueExpression expression)
          Creates a new source for UPDATE statement.
 

Method Detail

columnSourceByValues

ColumnSourceByValuesBuilder columnSourceByValues()
Creates a builder to add values as column sources in INSERT INTO statement.

Returns:
The new ColumnSourceByValuesBuilder for ColumnSourceByValues.

columnSourceByQuery

ColumnSourceByQuery columnSourceByQuery(QueryExpression query)

Creates a column source, which uses a query as a source for columns in INSERT INTO statement.

Calling this method is equivalent in calling columnSourceByQuery(ColumnNameList, QueryExpression) and passing null as first argument.

Parameters:
query - The query to use as source for columns in INSERT INTO statement.
Returns:
The new ColumnSourceByQuery.

columnSourceByQuery

ColumnSourceByQuery columnSourceByQuery(ColumnNameList columnNames,
                                        QueryExpression query)
Creates a column source, which uses specified target table column names and query as source columns in INSERT INTO statement.

Parameters:
columnNames - The column names to use in target table.
query - The query to use to populate target table.
Returns:
The new ColumnSourceByQuery.

deleteBySearch

DeleteBySearchBuilder deleteBySearch()
Creates builder to create DeleteBySearch statements.

Returns:
The new builder for DeleteBySearch.
See Also:
DeleteBySearchBuilder

insert

InsertStatementBuilder insert()
Creates builder to create InsertStatements.

Returns:
The new builder for InsertStatement.
See Also:
InsertStatementBuilder

updateBySearch

UpdateBySearchBuilder updateBySearch()
Creates builder to create UpdateBySearch statements.

Returns:
The new builder for UpdateBySearch statements.
See Also:
UpdateBySearchBuilder

createTargetTable

TargetTable createTargetTable(TableName tableName)

Creates new target table to use in modification statements.

Calling this method is equivalent for calling createTargetTable(TableName, Boolean) and passing false as second parameter.

Parameters:
tableName - The name of the table.
Returns:
The new TargetTable.

createTargetTable

TargetTable createTargetTable(TableName tableName,
                              Boolean isOnly)
Creates new target table to use in modification statements.

Parameters:
tableName - The name of the table.
isOnly - Whether modification should affect child-tables too.
Returns:
The new TargetTable.

updateSourceByExp

UpdateSourceByExpression updateSourceByExp(ValueExpression expression)
Creates a new source for UPDATE statement. This source will use specified expression as a source for values.

Parameters:
expression - The expression to use.
Returns:
The new UpdateSourceByExpression.
See Also:
UpdateBySearch

setClause

SetClause setClause(String updateTarget,
                    UpdateSource updateSource)
Creates a new set clause for UPDATE statement.

Parameters:
updateTarget - The target of the update, typically name of the column.
updateSource - The source for data to be put into that column.
Returns:
The new SetClause.
See Also:
UpdateBySearch


Copyright © 2010-2011. All Rights Reserved.