Top Fields Constructors Methods
org.hibernate.tool.schema.internal

public abstract Class AbstractSchemaMigrator

extends Object
implements SchemaMigrator
Class Inheritance
All Implemented Interfaces
org.hibernate.tool.schema.spi.SchemaMigrator
Known Direct Subclasses
org.hibernate.tool.schema.internal.GroupedSchemaMigratorImpl, org.hibernate.tool.schema.internal.IndividuallySchemaMigratorImpl
Imports
java.util.HashMap, .HashSet, .Iterator, .Map, .Set, java.util.function.Predicate, java.util.stream.Stream, .StreamSupport, org.hibernate.boot.Metadata, org.hibernate.boot.model.naming.Identifier, org.hibernate.boot.model.relational.AuxiliaryDatabaseObject, .Database, .Exportable, .Namespace, .Sequence, .SqlStringGenerationContext, org.hibernate.boot.model.relational.internal.SqlStringGenerationContextImpl, org.hibernate.boot.spi.MetadataImplementor, org.hibernate.dialect.Dialect, org.hibernate.engine.config.spi.ConfigurationService, .StandardConverters, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment, org.hibernate.engine.jdbc.internal.FormatStyle, .Formatter, org.hibernate.internal.util.StringHelper, org.hibernate.mapping.Constraint, .ForeignKey, .Index, .Table, .UniqueKey, org.hibernate.resource.transaction.spi.DdlTransactionIsolator, org.hibernate.tool.hbm2ddl.UniqueConstraintSchemaUpdateStrategy, org.hibernate.tool.schema.extract.spi.DatabaseInformation, .ForeignKeyInformation, .ForeignKeyInformation.ColumnReferenceMapping, .IndexInformation, .NameSpaceTablesInformation, .SequenceInformation, .TableInformation, org.hibernate.tool.schema.internal.exec.GenerationTarget, .JdbcContext, org.hibernate.tool.schema.spi.CommandAcceptanceException, .ExecutionOptions, .Exporter, .SchemaFilter, .SchemaManagementException, .SchemaMigrator, .TargetDescriptor, org.jboss.logging.Logger

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private static final Logger
protected SchemaFilter
protected HibernateSchemaManagementTool
private UniqueConstraintSchemaUpdateStrategy

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
applyForeignKeys(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)

Deprecated as a consequence of Table being deprecated.
protected void
applyIndexes(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)

Deprecated as a consequence of Table being deprecated.
private static void
applySqlString(boolean quiet, String sqlString, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)

protected static void
applySqlStrings(boolean quiet, String[] sqlStrings, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)

private static void
applySqlStrings(boolean quiet, Iterator<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)

Deprecated as a consequence of Table being deprecated.
protected void
checkExportIdentifier(Exportable exportable, Set<String> exportIdentifiers)

private boolean

Returns:

boolean, true if key already exists
checkForExistingForeignKey
(ForeignKey
- ForeignKey, new key to be created
foreignKey
,
TableInformation
- TableInformation, information of existing keys
tableInformation
)

Deprecated as a consequence of ForeignKey being deprecated.
Check if the ForeignKey already exists.
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)

Deprecated as a consequence of Table being deprecated.
private UniqueConstraintSchemaUpdateStrategy
public void
doMigration(Metadata
Represents the schema to be altered.
metadata
,
ExecutionOptions
Options for executing the alteration
options
,
TargetDescriptor
description of the target(s) for the alteration commands
targetDescriptor
)

Implements org.hibernate.tool.schema.spi.SchemaMigrator.doMigration.

Perform a schema migration (alteration) from the indicated source(s) to the indicated target(s).
pack-priv boolean
equivalentForeignKeyExistsInDatabase(TableInformation tableInformation, String referencingColumn, String referencedTable)

private IndexInformation
findMatchingIndex(Index index, TableInformation tableInformation)

Deprecated as a consequence of Index being deprecated.
protected void
migrateTable(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)

Deprecated as a consequence of Table being deprecated.
private void
performMigration(Metadata metadata, DatabaseInformation existingDatabase, ExecutionOptions options, Dialect dialect, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)

protected abstract NameSpaceTablesInformation
performTablesMigration(Metadata metadata, DatabaseInformation existingDatabase, ExecutionOptions options, Dialect dialect, Formatter formatter, Set<String> exportIdentifiers, boolean tryToCreateCatalogs, boolean tryToCreateSchemas, Set<Identifier> exportedCatalogs, Namespace namespace, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget[] targets)

public void
setUniqueConstraintStrategy(UniqueConstraintSchemaUpdateStrategy uniqueConstraintStrategy)

For testing...

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

logback to summary
private static final Logger log
schemaFilterback to summary
protected SchemaFilter schemaFilter
toolback to summary
protected HibernateSchemaManagementTool tool
uniqueConstraintStrategyback to summary
private UniqueConstraintSchemaUpdateStrategy uniqueConstraintStrategy

Constructor Detail

AbstractSchemaMigratorback to summary
public AbstractSchemaMigrator(HibernateSchemaManagementTool tool, SchemaFilter schemaFilter)

Method Detail

applyForeignKeysback to summary
protected void applyForeignKeys(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)

Deprecated

as a consequence of Table being deprecated. See corresponding docs for further information.

applyIndexesback to summary
protected void applyIndexes(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)

Deprecated

as a consequence of Table being deprecated. See corresponding docs for further information.

applySqlStringback to summary
private static void applySqlString(boolean quiet, String sqlString, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)
applySqlStringsback to summary
protected static void applySqlStrings(boolean quiet, String[] sqlStrings, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)
applySqlStringsback to summary
private static void applySqlStrings(boolean quiet, Iterator<String> sqlStrings, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)
applyUniqueKeysback to summary
protected void applyUniqueKeys(Table table, TableInformation tableInfo, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)

Deprecated

as a consequence of Table being deprecated. See corresponding docs for further information.

checkExportIdentifierback to summary
protected void checkExportIdentifier(Exportable exportable, Set<String> exportIdentifiers)
checkForExistingForeignKeyback to summary
private boolean checkForExistingForeignKey(ForeignKey foreignKey, TableInformation tableInformation)

Deprecated

as a consequence of ForeignKey being deprecated. See corresponding docs for further information.

Check if the ForeignKey already exists. First check based on definition and if that is not matched check if a key with the exact same name exists. Keys with the same name are presumed to be functional equal.

Parameters
foreignKey:ForeignKey

- ForeignKey, new key to be created

tableInformation:TableInformation

- TableInformation, information of existing keys

Returns:boolean

boolean, true if key already exists

createSchemaAndCatalogback to summary
protected void createSchemaAndCatalog(DatabaseInformation existingDatabase, ExecutionOptions options, Dialect dialect, Formatter formatter, boolean tryToCreateCatalogs, boolean tryToCreateSchemas, Set<Identifier> exportedCatalogs, Namespace namespace, GenerationTarget[] targets)
createTableback to summary
protected void createTable(Table table, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)

Deprecated

as a consequence of Table being deprecated. See corresponding docs for further information.

determineUniqueConstraintSchemaUpdateStrategyback to summary
private UniqueConstraintSchemaUpdateStrategy determineUniqueConstraintSchemaUpdateStrategy(Metadata metadata)
doMigrationback to summary
public void doMigration(Metadata metadata, ExecutionOptions options, TargetDescriptor targetDescriptor)

Implements org.hibernate.tool.schema.spi.SchemaMigrator.doMigration.

Doc from org.hibernate.tool.schema.spi.SchemaMigrator.doMigration.

Perform a schema migration (alteration) from the indicated source(s) to the indicated target(s).

Parameters
metadata:Metadata

Represents the schema to be altered.

options:ExecutionOptions

Options for executing the alteration

targetDescriptor:TargetDescriptor

description of the target(s) for the alteration commands

Annotations
@Override
equivalentForeignKeyExistsInDatabaseback to summary
pack-priv boolean equivalentForeignKeyExistsInDatabase(TableInformation tableInformation, String referencingColumn, String referencedTable)
findMatchingIndexback to summary
private IndexInformation findMatchingIndex(Index index, TableInformation tableInformation)

Deprecated

as a consequence of Index being deprecated. See corresponding docs for further information.

migrateTableback to summary
protected void migrateTable(Table table, TableInformation tableInformation, Dialect dialect, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)

Deprecated

as a consequence of Table being deprecated. See corresponding docs for further information.

performMigrationback to summary
private void performMigration(Metadata metadata, DatabaseInformation existingDatabase, ExecutionOptions options, Dialect dialect, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)
performTablesMigrationback to summary
protected abstract NameSpaceTablesInformation performTablesMigration(Metadata metadata, DatabaseInformation existingDatabase, ExecutionOptions options, Dialect dialect, Formatter formatter, Set<String> exportIdentifiers, boolean tryToCreateCatalogs, boolean tryToCreateSchemas, Set<Identifier> exportedCatalogs, Namespace namespace, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget[] targets)
setUniqueConstraintStrategyback to summary
public void setUniqueConstraintStrategy(UniqueConstraintSchemaUpdateStrategy uniqueConstraintStrategy)

For testing...