Class HibernateDdlExecutor
java.lang.Object
com.atlassian.confluence.upgrade.ddl.HibernateDdlExecutor
- All Implemented Interfaces:
DdlExecutor
Executes any set of
DdlCommand
s thrown its way.- Since:
- 4.0
-
Constructor Summary
ConstructorsConstructorDescriptionHibernateDdlExecutor
(HibernateDatabaseCapabilities databaseCapabilities, org.hibernate.SessionFactory sessionFactory) -
Method Summary
Modifier and TypeMethodDescriptioncreateCreateIndexCommand
(String indexName, String tableName, boolean isUnique, String... columnNames) Create a compound indexcreateCreateIndexCommand
(String indexName, String tableName, String... columnNames) Create a compound non-unique indexcreateDropIndexCommand
(String indexName, String tableName) createDropTableCommand
(String tableName) createDropTableIfExistsCommand
(String tableName) createRenameTableCommand
(String oldTableName, String newTableName) createUniqueConstraintWithMultipleNullsCommand
(String constraintName, String tableName, String columnName) void
executeDdl
(List<? extends DdlCommand> commands) Perform a set of data definition altering actions.void
executeDdlStatements
(List<String> statements) getDdlStatements
(List<? extends DdlCommand> commands)
-
Constructor Details
-
HibernateDdlExecutor
public HibernateDdlExecutor(HibernateDatabaseCapabilities databaseCapabilities, org.hibernate.SessionFactory sessionFactory) - Since:
- 7.13.17
-
-
Method Details
-
createCreateIndexCommand
public CreateIndexCommand createCreateIndexCommand(String indexName, String tableName, String... columnNames) Create a compound non-unique index- Specified by:
createCreateIndexCommand
in interfaceDdlExecutor
- Parameters:
indexName
- the index nametableName
- the table namecolumnNames
- a set of column names- Returns:
- a CreateIndexCommand object for execution
-
createCreateIndexCommand
public CreateIndexCommand createCreateIndexCommand(String indexName, String tableName, boolean isUnique, String... columnNames) Create a compound index- Specified by:
createCreateIndexCommand
in interfaceDdlExecutor
- Parameters:
indexName
- the index nametableName
- the table nameisUnique
- true if the index is uniquecolumnNames
- a set of column names- Returns:
- a CreateIndexCommand object for execution
- Since:
- 6.0
-
createUniqueConstraintWithMultipleNullsCommand
public CreateUniqueConstraintWithMultipleNullsCommand createUniqueConstraintWithMultipleNullsCommand(String constraintName, String tableName, String columnName) - Specified by:
createUniqueConstraintWithMultipleNullsCommand
in interfaceDdlExecutor
-
createDropIndexCommand
- Specified by:
createDropIndexCommand
in interfaceDdlExecutor
-
createDropTableCommand
- Specified by:
createDropTableCommand
in interfaceDdlExecutor
-
createDropTableIfExistsCommand
- Specified by:
createDropTableIfExistsCommand
in interfaceDdlExecutor
-
createRenameTableCommand
- Specified by:
createRenameTableCommand
in interfaceDdlExecutor
-
executeDdl
Description copied from interface:DdlExecutor
Perform a set of data definition altering actions. Each action is executed as a separate statement.- Specified by:
executeDdl
in interfaceDdlExecutor
- Parameters:
commands
- A collection of ddl commands to perform
-
executeDdlStatements
- Specified by:
executeDdlStatements
in interfaceDdlExecutor
-
getDdlStatements
- Specified by:
getDdlStatements
in interfaceDdlExecutor
-