Class AbstractSchemaMigrator
- java.lang.Object
-
- org.hibernate.tool.schema.internal.AbstractSchemaMigrator
-
- All Implemented Interfaces:
SchemaMigrator
- Direct Known Subclasses:
GroupedSchemaMigratorImpl
,IndividuallySchemaMigratorImpl
public abstract class AbstractSchemaMigrator extends Object implements SchemaMigrator
-
-
Field Summary
Fields Modifier and Type Field Description protected SchemaFilter
schemaFilter
protected HibernateSchemaManagementTool
tool
-
Constructor Summary
Constructors Constructor Description AbstractSchemaMigrator(HibernateSchemaManagementTool tool, SchemaFilter schemaFilter)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
applyForeignKeys(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)
protected void
applyIndexes(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)
protected static void
applySqlStrings(boolean quiet, String[] sqlStrings, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)
protected void
applyUniqueKeys(Table table, TableInformation tableInfo, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)
protected void
checkExportIdentifier(Exportable exportable, Set<String> exportIdentifiers)
protected void
createSchemaAndCatalog(DatabaseInformation existingDatabase, ExecutionOptions options, Dialect dialect, Formatter formatter, boolean tryToCreateCatalogs, boolean tryToCreateSchemas, Set<Identifier> exportedCatalogs, Namespace namespace, GenerationTarget[] targets)
protected void
createTable(Table table, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)
void
doMigration(Metadata metadata, ExecutionOptions options, ContributableMatcher contributableInclusionFilter, TargetDescriptor targetDescriptor)
Perform a schema migration (alteration) from the indicated source(s) to the indicated target(s).protected void
migrateTable(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)
protected abstract NameSpaceTablesInformation
performTablesMigration(Metadata metadata, DatabaseInformation existingDatabase, ExecutionOptions options, ContributableMatcher contributableInclusionFilter, Dialect dialect, Formatter formatter, Set<String> exportIdentifiers, boolean tryToCreateCatalogs, boolean tryToCreateSchemas, Set<Identifier> exportedCatalogs, Namespace namespace, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget[] targets)
void
setUniqueConstraintStrategy(UniqueConstraintSchemaUpdateStrategy uniqueConstraintStrategy)
For testing...
-
-
-
Field Detail
-
tool
protected HibernateSchemaManagementTool tool
-
schemaFilter
protected SchemaFilter schemaFilter
-
-
Constructor Detail
-
AbstractSchemaMigrator
public AbstractSchemaMigrator(HibernateSchemaManagementTool tool, SchemaFilter schemaFilter)
-
-
Method Detail
-
setUniqueConstraintStrategy
public void setUniqueConstraintStrategy(UniqueConstraintSchemaUpdateStrategy uniqueConstraintStrategy)
For testing...
-
doMigration
public void doMigration(Metadata metadata, ExecutionOptions options, ContributableMatcher contributableInclusionFilter, TargetDescriptor targetDescriptor)
Description copied from interface:SchemaMigrator
Perform a schema migration (alteration) from the indicated source(s) to the indicated target(s).- Specified by:
doMigration
in interfaceSchemaMigrator
- Parameters:
metadata
- Represents the schema to be altered.options
- Options for executing the alterationcontributableInclusionFilter
- Filter for Contributable instances to usetargetDescriptor
- description of the target(s) for the alteration commands
-
performTablesMigration
protected abstract NameSpaceTablesInformation performTablesMigration(Metadata metadata, DatabaseInformation existingDatabase, ExecutionOptions options, ContributableMatcher contributableInclusionFilter, Dialect dialect, Formatter formatter, Set<String> exportIdentifiers, boolean tryToCreateCatalogs, boolean tryToCreateSchemas, Set<Identifier> exportedCatalogs, Namespace namespace, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget[] targets)
-
createTable
protected void createTable(Table table, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)
-
migrateTable
protected void migrateTable(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)
-
applyIndexes
protected void applyIndexes(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)
-
applyUniqueKeys
protected void applyUniqueKeys(Table table, TableInformation tableInfo, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)
-
applyForeignKeys
protected void applyForeignKeys(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)
-
checkExportIdentifier
protected void checkExportIdentifier(Exportable exportable, Set<String> exportIdentifiers)
-
applySqlStrings
protected static void applySqlStrings(boolean quiet, String[] sqlStrings, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)
-
createSchemaAndCatalog
protected void createSchemaAndCatalog(DatabaseInformation existingDatabase, ExecutionOptions options, Dialect dialect, Formatter formatter, boolean tryToCreateCatalogs, boolean tryToCreateSchemas, Set<Identifier> exportedCatalogs, Namespace namespace, GenerationTarget[] targets)
-
-