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 ofDdlCommand
s 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 CreateIndexCommand
createCreateIndexCommand(String indexName, String tableName, boolean isUnique, String... columnNames)
Create a compound indexCreateIndexCommand
createCreateIndexCommand(String indexName, String tableName, String... columnNames)
Create a compound non-unique indexDropIndexCommand
createDropIndexCommand(String indexName, String tableName)
DropTableCommand
createDropTableCommand(String tableName)
RenameTableCommand
createRenameTableCommand(String oldTableName, String newTableName)
CreateUniqueConstraintWithMultipleNullsCommand
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)
List<String>
getDdlStatements(List<? extends DdlCommand> commands)
-
-
-
Constructor Detail
-
HibernateDdlExecutor
public HibernateDdlExecutor(HibernateDatabaseCapabilities databaseCapabilities, org.hibernate.SessionFactory sessionFactory)
- Since:
- 7.20
-
-
Method Detail
-
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
public DropIndexCommand createDropIndexCommand(String indexName, String tableName)
- Specified by:
createDropIndexCommand
in interfaceDdlExecutor
-
createDropTableCommand
public DropTableCommand createDropTableCommand(String tableName)
- Specified by:
createDropTableCommand
in interfaceDdlExecutor
-
createRenameTableCommand
public RenameTableCommand createRenameTableCommand(String oldTableName, String newTableName)
- Specified by:
createRenameTableCommand
in interfaceDdlExecutor
-
executeDdl
public void executeDdl(List<? extends DdlCommand> commands)
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
public void executeDdlStatements(List<String> statements)
- Specified by:
executeDdlStatements
in interfaceDdlExecutor
-
getDdlStatements
public List<String> getDdlStatements(List<? extends DdlCommand> commands)
- Specified by:
getDdlStatements
in interfaceDdlExecutor
-
-