Class HibernateDdlExecutor
- java.lang.Object
-
- com.atlassian.confluence.upgrade.ddl.HibernateDdlExecutor
-
- All Implemented Interfaces:
DdlExecutor
public class HibernateDdlExecutor extends Object implements DdlExecutor
Executes any set ofDdlCommands thrown its way.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description HibernateDdlExecutor(HibernateDatabaseCapabilities databaseCapabilities, org.hibernate.SessionFactory sessionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CreateIndexCommandcreateCreateIndexCommand(String indexName, String tableName, boolean isUnique, String... columnNames)Create a compound indexCreateIndexCommandcreateCreateIndexCommand(String indexName, String tableName, String... columnNames)Create a compound non-unique indexDropIndexCommandcreateDropIndexCommand(String indexName, String tableName)DropTableCommandcreateDropTableCommand(String tableName)RenameTableCommandcreateRenameTableCommand(String oldTableName, String newTableName)CreateUniqueConstraintWithMultipleNullsCommandcreateUniqueConstraintWithMultipleNullsCommand(String constraintName, String tableName, String columnName)voidexecuteDdl(List<? extends DdlCommand> commands)Perform a set of data definition altering actions.voidexecuteDdlStatements(List<String> statements)List<String>getDdlStatements(List<? extends DdlCommand> commands)
-
-
-
Constructor Detail
-
HibernateDdlExecutor
public HibernateDdlExecutor(HibernateDatabaseCapabilities databaseCapabilities, org.hibernate.SessionFactory sessionFactory)
- Since:
- 7.13.17
-
-
Method Detail
-
createCreateIndexCommand
public CreateIndexCommand createCreateIndexCommand(String indexName, String tableName, String... columnNames)
Create a compound non-unique index- Specified by:
createCreateIndexCommandin 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:
createCreateIndexCommandin 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:
createUniqueConstraintWithMultipleNullsCommandin interfaceDdlExecutor
-
createDropIndexCommand
public DropIndexCommand createDropIndexCommand(String indexName, String tableName)
- Specified by:
createDropIndexCommandin interfaceDdlExecutor
-
createDropTableCommand
public DropTableCommand createDropTableCommand(String tableName)
- Specified by:
createDropTableCommandin interfaceDdlExecutor
-
createRenameTableCommand
public RenameTableCommand createRenameTableCommand(String oldTableName, String newTableName)
- Specified by:
createRenameTableCommandin interfaceDdlExecutor
-
executeDdl
public void executeDdl(List<? extends DdlCommand> commands)
Description copied from interface:DdlExecutorPerform a set of data definition altering actions. Each action is executed as a separate statement.- Specified by:
executeDdlin interfaceDdlExecutor- Parameters:
commands- A collection of ddl commands to perform
-
executeDdlStatements
public void executeDdlStatements(List<String> statements)
- Specified by:
executeDdlStatementsin interfaceDdlExecutor
-
getDdlStatements
public List<String> getDdlStatements(List<? extends DdlCommand> commands)
- Specified by:
getDdlStatementsin interfaceDdlExecutor
-
-