Interface AlterTableExecutor
-
- All Known Implementing Classes:
HibernateAlterTableExecutor
public interface AlterTableExecutorExecutes all the various database-specific table altering commands.PLEASE READ: Due to CONFDEV-7957 (and until HSQLDB addresses their concurrency issues), any upgrade tasks that composes this executor must be wrapped in a transaction proxy with REQUIRES_NEW propagation.
- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidalterTable(String tableName, List<? extends AlterTableCommand> commands)Perform a set of table altering actions on a given table.AddUniqueConstraintCommandcreateAddUniqueConstraintCommand(String constraintName, String... columnNames)AlterColumnNullabilityCommandcreateAlterColumnNullChoiceCommand(String columnName, String oldDataType, NullChoice nullChoice)DropUniqueConstraintByColumnsCommandcreateDropUniqueConstraintByColumnsCommand(String... columnNames)Drop constraints by column names.DropUniqueConstraintCommandcreateDropUniqueConstraintCommand(String constraintName)AlterTableCommandcreateDropUniqueConstraintIfExistsCommand(String bandanaUniqueKey)List<String>getAlterTableStatements(String tableName, List<? extends AlterTableCommand> commands)
-
-
-
Method Detail
-
createAlterColumnNullChoiceCommand
AlterColumnNullabilityCommand createAlterColumnNullChoiceCommand(String columnName, String oldDataType, NullChoice nullChoice)
-
createAddUniqueConstraintCommand
AddUniqueConstraintCommand createAddUniqueConstraintCommand(String constraintName, String... columnNames)
-
createDropUniqueConstraintCommand
DropUniqueConstraintCommand createDropUniqueConstraintCommand(String constraintName)
-
createDropUniqueConstraintIfExistsCommand
AlterTableCommand createDropUniqueConstraintIfExistsCommand(String bandanaUniqueKey)
-
createDropUniqueConstraintByColumnsCommand
DropUniqueConstraintByColumnsCommand createDropUniqueConstraintByColumnsCommand(String... columnNames)
Drop constraints by column names. This operation is presently only supported for Oracle.- Parameters:
tableName- Name of the table to altercolumnNames- The names of the columns that make up the unique constraint
-
alterTable
void alterTable(String tableName, List<? extends AlterTableCommand> commands)
Perform a set of table altering actions on a given table. On some databases such as PostgreSQL this is combined into a single statement automatically. On other databases such as HSQLDB, each alter action is executed as a separate statement.- Parameters:
tableName- Name of the table to altercommands- A collection of alter table actions to perform
-
getAlterTableStatements
List<String> getAlterTableStatements(String tableName, List<? extends AlterTableCommand> commands)
-
-