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

All Known Subinterfaces:
PgSQLManipulationFactory

public interface ManipulationFactory

This is factory for creating builders and syntax elements related to SQL Data Manipulation (typically ALTER and DROP statements).

Author:
Stanislav Muhametsin

Method Summary
 AddColumnDefinition createAddColumnDefinition(ColumnDefinition definition)
          Creates the syntax element for adding column (ADD COLUMN ...) in ALTER TABLE statement.
 AddTableConstraintDefinition createAddTableConstraintDefinition(TableConstraintDefinition constraintDefinition)
          Creates the syntax element for adding table constraint(ADD ...) in ALTER TABLE statement.
 AlterColumnDefinition createAlterColumnDefinition(java.lang.String columnName, AlterColumnAction action)
          Creates the syntax element for altering column definition (ALTER COLUMN) in ALTER TABLE statement.
 AlterTableStatement createAlterTableStatement(TableName tableName, AlterTableAction action)
          Creates the ALTER TABLE statement with specified parameter.
 DropColumnDefinition createDropColumnDefinition(java.lang.String columnName, DropBehaviour dropBehaviour)
          Creates the syntax element for dropping a column definition (DROP COLUMN) in ALTER TABLE statement.
 DropSchemaStatement createDropSchemaStatement(java.lang.String schemaName, DropBehaviour dropBehaviour)
          Creates the statement to drop schema (DROP SCHEMA ...).
 DropTableConstraintDefinition createDropTableConstraintDefinition(java.lang.String constraintName, DropBehaviour dropBehaviour)
          Creates the syntax element for dropping a table constraint (DROP CONSTRAINT ...) in ALTER TABLE statement.
 DropTableOrViewStatement createDropTableOrViewStatement(TableName tableName, ObjectType theType, DropBehaviour dropBehaviour)
          Creates the statement to drop table (DROP TABLE ...) or view (DROP VIEW ...).
 SetColumnDefault createSetColumnDefault(java.lang.String newDefault)
          Creates the syntax element for setting a new default for column (SET DEFAULT ...) in ALTER TABLE statement.
 

Method Detail

createAlterTableStatement

AlterTableStatement createAlterTableStatement(TableName tableName,
                                              AlterTableAction action)
Creates the ALTER TABLE statement with specified parameter.

Parameters:
tableName - The name of the table.
action - The action to be done to the table.
Returns:
The ALTER TABLE statement syntax element.
See Also:
AlterTableStatement, createAddColumnDefinition(ColumnDefinition), createAddTableConstraintDefinition(TableConstraintDefinition), createAlterColumnDefinition(String, AlterColumnAction), createDropColumnDefinition(String, DropBehaviour), createDropTableConstraintDefinition(String, DropBehaviour)

createAddColumnDefinition

AddColumnDefinition createAddColumnDefinition(ColumnDefinition definition)
Creates the syntax element for adding column (ADD COLUMN ...) in ALTER TABLE statement.

Parameters:
definition - The column to add to table.
Returns:
The syntax element for adding column (ADD COLUMN ...) in ALTER TABLE statement.
See Also:
AlterTableStatement

createAddTableConstraintDefinition

AddTableConstraintDefinition createAddTableConstraintDefinition(TableConstraintDefinition constraintDefinition)
Creates the syntax element for adding table constraint(ADD ...) in ALTER TABLE statement.

Parameters:
constraintDefinition - The table constraint to add to table.
Returns:
The syntax element for adding table constraint (ADD ...) in ALTER TABLE statement.
See Also:
AlterTableStatement

createAlterColumnDefinition

AlterColumnDefinition createAlterColumnDefinition(java.lang.String columnName,
                                                  AlterColumnAction action)
Creates the syntax element for altering column definition (ALTER COLUMN) in ALTER TABLE statement.

Parameters:
columnName - The name of the column to alter.
action - The way how column should be altered.
Returns:
The syntax element for altering column definition (ALTER COLUMN) in ALTER TABLE statement.
See Also:
AlterColumnAction, AlterColumnAction.DropDefault, createSetColumnDefault(String)

createSetColumnDefault

SetColumnDefault createSetColumnDefault(java.lang.String newDefault)
Creates the syntax element for setting a new default for column (SET DEFAULT ...) in ALTER TABLE statement.

Parameters:
newDefault - The new default value for column.
Returns:
The syntax element for setting a new default for column (SET DEFAULT ...) in ALTER TABLE statement.
See Also:
AlterColumnAction

createDropColumnDefinition

DropColumnDefinition createDropColumnDefinition(java.lang.String columnName,
                                                DropBehaviour dropBehaviour)
Creates the syntax element for dropping a column definition (DROP COLUMN) in ALTER TABLE statement.

Parameters:
columnName - The name of the column to drop.
dropBehaviour - The drop behaviour.
Returns:
The syntax element for dropping a column definition (DROP COLUMN) in ALTER TABLE statement.
See Also:
DropBehaviour, AlterTableStatement

createDropTableConstraintDefinition

DropTableConstraintDefinition createDropTableConstraintDefinition(java.lang.String constraintName,
                                                                  DropBehaviour dropBehaviour)
Creates the syntax element for dropping a table constraint (DROP CONSTRAINT ...) in ALTER TABLE statement.

Parameters:
constraintName - The name of the constraint to drop.
dropBehaviour - The drop behaviour.
Returns:
The syntax element for dropping a table constraint (DROP CONSTRAINT ...) in ALTER TABLE statement.
See Also:
DropBehaviour, AlterTableStatement

createDropSchemaStatement

DropSchemaStatement createDropSchemaStatement(java.lang.String schemaName,
                                              DropBehaviour dropBehaviour)
Creates the statement to drop schema (DROP SCHEMA ...).

Parameters:
schemaName - The name of the schema to drop.
dropBehaviour - The drop behaviour.
Returns:
The statement to drop schema (DROP SCHEMA ...).

createDropTableOrViewStatement

DropTableOrViewStatement createDropTableOrViewStatement(TableName tableName,
                                                        ObjectType theType,
                                                        DropBehaviour dropBehaviour)
Creates the statement to drop table (DROP TABLE ...) or view (DROP VIEW ...).

Parameters:
tableName - The name of the table or view to drop.
theType - What to drop. Must be either ObjectType.TABLE for tables or ObjectType.VIEW for views.
dropBehaviour - The drop behaviour.
Returns:
The statement to drop table (DROP TABLE ...) or view (DROP VIEW ...).
See Also:
DropBehaviour, ObjectType


Copyright © 2010. All Rights Reserved.