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

public Class SchemaCreatorImpl

extends Object
implements SchemaCreator
Class Inheritance
All Implemented Interfaces
org.hibernate.tool.schema.spi.SchemaCreator
Imports
java.net.URL, java.util.ArrayList, .Collections, .HashSet, .Iterator, .List, .Map, .Set, org.hibernate.boot.Metadata, org.hibernate.boot.model.naming.Identifier, org.hibernate.boot.model.relational.AuxiliaryDatabaseObject, .Database, .Exportable, .InitCommand, .Namespace, .Sequence, .SqlStringGenerationContext, org.hibernate.boot.model.relational.internal.SqlStringGenerationContextImpl, org.hibernate.boot.registry.classloading.spi.ClassLoaderService, org.hibernate.boot.spi.MetadataImplementor, org.hibernate.cfg.AvailableSettings, org.hibernate.dialect.Dialect, org.hibernate.engine.config.spi.ConfigurationService, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment, org.hibernate.engine.jdbc.internal.FormatStyle, .Formatter, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.internal.util.StringHelper, org.hibernate.internal.util.config.ConfigurationHelper, org.hibernate.mapping.ForeignKey, .Index, .Table, .UniqueKey, org.hibernate.service.ServiceRegistry, org.hibernate.service.spi.ServiceRegistryImplementor, org.hibernate.tool.hbm2ddl.ImportSqlCommandExtractor, org.hibernate.tool.schema.SourceType, org.hibernate.tool.schema.internal.exec.GenerationTarget, .JdbcContext, .ScriptSourceInputFromUrl, .ScriptSourceInputNonExistentImpl, org.hibernate.tool.schema.spi.CommandAcceptanceException, .ExceptionHandler, .ExecutionOptions, .SchemaCreator, .SchemaFilter, .SchemaManagementException, .SchemaManagementTool, .ScriptSourceInput, .SourceDescriptor, .TargetDescriptor

This is functionally nothing more than the creation script from the older SchemaExport class (plus some additional stuff in the script).
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
public static final String
private static final CoreMessageLogger
private final SchemaFilter
private final HibernateSchemaManagementTool

Constructor Summary

AccessConstructor and Description
public
public
public
public
SchemaCreatorImpl(ServiceRegistry serviceRegistry, SchemaFilter schemaFilter)

Method Summary

Modifier and TypeMethod and Description
private void
applyImportSources(ExecutionOptions options, ImportSqlCommandExtractor commandExtractor, boolean format, GenerationTarget... targets)

private static void
applySqlString(String sqlString, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)

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

private static void
checkExportIdentifier(Exportable exportable, Set<String> exportIdentifiers)

public void
createFromMetadata(Metadata metadata, ExecutionOptions options, Dialect dialect, Formatter formatter, GenerationTarget... targets)

public void
createFromScript(ScriptSourceInput scriptSourceInput, ImportSqlCommandExtractor commandExtractor, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)

public void
doCreation(Metadata
Represents the schema to be created.
metadata
,
ExecutionOptions
Options for executing the creation
options
,
SourceDescriptor
description of the source(s) of creation commands
sourceDescriptor
,
TargetDescriptor
description of the target(s) for the creation commands
targetDescriptor
)

Implements org.hibernate.tool.schema.spi.SchemaCreator.doCreation.

Perform a schema creation from the indicated source(s) to the indicated target(s).
public void
doCreation(Metadata metadata, Dialect dialect, ExecutionOptions options, SourceDescriptor sourceDescriptor, GenerationTarget... targets)

public void
doCreation(Metadata metadata, final boolean manageNamespaces, GenerationTarget... targets)

public void
doCreation(Metadata metadata, final ServiceRegistry serviceRegistry, final Map<K, V> settings, final boolean manageNamespaces, GenerationTarget... targets)

public List<String>

Returns:

The generation commands
generateCreationCommands
(Metadata
The metadata for which to generate the creation commands.
metadata
,
final boolean manageNamespaces)

For testing...

private ScriptSourceInput
interpretLegacyImportScriptSetting(String resourceName, ClassLoaderService classLoaderService, String charsetName)

private void
performCreation(Metadata metadata, Dialect dialect, ExecutionOptions options, SourceDescriptor sourceDescriptor, GenerationTarget... targets)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_IMPORT_FILEback to summary
public static final String DEFAULT_IMPORT_FILE
logback to summary
private static final CoreMessageLogger log
schemaFilterback to summary
private final SchemaFilter schemaFilter
toolback to summary
private final HibernateSchemaManagementTool tool

Constructor Detail

SchemaCreatorImplback to summary
public SchemaCreatorImpl(HibernateSchemaManagementTool tool)
SchemaCreatorImplback to summary
public SchemaCreatorImpl(HibernateSchemaManagementTool tool, SchemaFilter schemaFilter)
SchemaCreatorImplback to summary
public SchemaCreatorImpl(ServiceRegistry serviceRegistry)
SchemaCreatorImplback to summary
public SchemaCreatorImpl(ServiceRegistry serviceRegistry, SchemaFilter schemaFilter)

Method Detail

applyImportSourcesback to summary
private void applyImportSources(ExecutionOptions options, ImportSqlCommandExtractor commandExtractor, boolean format, GenerationTarget... targets)
applySqlStringback to summary
private static void applySqlString(String sqlString, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)
applySqlStringsback to summary
private static void applySqlStrings(String[] sqlStrings, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)
checkExportIdentifierback to summary
private static void checkExportIdentifier(Exportable exportable, Set<String> exportIdentifiers)
createFromMetadataback to summary
public void createFromMetadata(Metadata metadata, ExecutionOptions options, Dialect dialect, Formatter formatter, GenerationTarget... targets)
createFromScriptback to summary
public void createFromScript(ScriptSourceInput scriptSourceInput, ImportSqlCommandExtractor commandExtractor, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)
doCreationback to summary
public void doCreation(Metadata metadata, ExecutionOptions options, SourceDescriptor sourceDescriptor, TargetDescriptor targetDescriptor)

Implements org.hibernate.tool.schema.spi.SchemaCreator.doCreation.

Doc from org.hibernate.tool.schema.spi.SchemaCreator.doCreation.

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

Parameters
metadata:Metadata

Represents the schema to be created.

options:ExecutionOptions

Options for executing the creation

sourceDescriptor:SourceDescriptor

description of the source(s) of creation commands

targetDescriptor:TargetDescriptor

description of the target(s) for the creation commands

Annotations
@Override
doCreationback to summary
public void doCreation(Metadata metadata, Dialect dialect, ExecutionOptions options, SourceDescriptor sourceDescriptor, GenerationTarget... targets)
doCreationback to summary
public void doCreation(Metadata metadata, final boolean manageNamespaces, GenerationTarget... targets)
doCreationback to summary
public void doCreation(Metadata metadata, final ServiceRegistry serviceRegistry, final Map<K, V> settings, final boolean manageNamespaces, GenerationTarget... targets)
generateCreationCommandsback to summary
public List<String> generateCreationCommands(Metadata metadata, final boolean manageNamespaces)

For testing...

Parameters
metadata:Metadata

The metadata for which to generate the creation commands.

Returns:List<String>

The generation commands

interpretLegacyImportScriptSettingback to summary
private ScriptSourceInput interpretLegacyImportScriptSetting(String resourceName, ClassLoaderService classLoaderService, String charsetName)
performCreationback to summary
private void performCreation(Metadata metadata, Dialect dialect, ExecutionOptions options, SourceDescriptor sourceDescriptor, GenerationTarget... targets)
org.hibernate.tool.schema.internal back to summary

private Class SchemaCreatorImpl.JournalingGenerationTarget

extends Object
implements GenerationTarget
Class Inheritance
  • java.lang.Object
  • org.hibernate.tool.schema.internal.SchemaCreatorImpl.JournalingGenerationTarget
All Implemented Interfaces
org.hibernate.tool.schema.internal.exec.GenerationTarget

Field Summary

Modifier and TypeField and Description
private final ArrayList<String>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
accept(String
The command
command
)

Implements org.hibernate.tool.schema.internal.exec.GenerationTarget.accept.

Accept a command
public void
public void
release()

Implements org.hibernate.tool.schema.internal.exec.GenerationTarget.release.

Release this target, giving it a change to release its resources.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

commandsback to summary
private final ArrayList<String> commands

Constructor Detail

JournalingGenerationTargetback to summary
private JournalingGenerationTarget()

Method Detail

acceptback to summary
public void accept(String command)

Implements org.hibernate.tool.schema.internal.exec.GenerationTarget.accept.

Doc from org.hibernate.tool.schema.internal.exec.GenerationTarget.accept.

Accept a command

Parameters
command:String

The command

Annotations
@Override
prepareback to summary
public void prepare()

Implements org.hibernate.tool.schema.internal.exec.GenerationTarget.prepare.

Doc from org.hibernate.tool.schema.internal.exec.GenerationTarget.prepare.

Prepare for accepting actions

Annotations
@Override
releaseback to summary
public void release()

Implements org.hibernate.tool.schema.internal.exec.GenerationTarget.release.

Doc from org.hibernate.tool.schema.internal.exec.GenerationTarget.release.

Release this target, giving it a change to release its resources.

Annotations
@Override