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
Base implementation ofSchemaMigrator
.
-
-
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 sqlGenerationContext, GenerationTarget... targets)
protected void
applyIndexes(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlGenerationContext, 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 sqlGenerationContext, 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, SqlStringGenerationContext context, GenerationTarget[] targets)
protected void
createTable(Table table, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlGenerationContext, 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 sqlGenerationContext, 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 sqlGenerationContext, GenerationTarget[] targets)
-
-
-
Field Detail
-
tool
protected HibernateSchemaManagementTool tool
-
schemaFilter
protected SchemaFilter schemaFilter
-
-
Constructor Detail
-
AbstractSchemaMigrator
public AbstractSchemaMigrator(HibernateSchemaManagementTool tool, SchemaFilter schemaFilter)
-
-
Method Detail
-
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 sqlGenerationContext, GenerationTarget[] targets)
-
createTable
protected void createTable(Table table, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlGenerationContext, GenerationTarget... targets)
-
migrateTable
protected void migrateTable(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlGenerationContext, GenerationTarget... targets)
-
applyIndexes
protected void applyIndexes(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlGenerationContext, GenerationTarget... targets)
-
applyUniqueKeys
protected void applyUniqueKeys(Table table, TableInformation tableInfo, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlGenerationContext, GenerationTarget... targets)
-
applyForeignKeys
protected void applyForeignKeys(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlGenerationContext, 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, SqlStringGenerationContext context, GenerationTarget[] targets)
-
-