Top Description Inners Fields Constructors Methods
org.hibernate.tool.hbm2ddl

public Class SchemaUpdate

extends Object
Class Inheritance
Imports
java.io.File, .FileInputStream, java.util.ArrayList, .EnumSet, .HashMap, .List, .Map, .Properties, org.hibernate.boot.Metadata, .MetadataBuilder, .MetadataSources, org.hibernate.boot.model.naming.ImplicitNamingStrategy, .PhysicalNamingStrategy, org.hibernate.boot.registry.BootstrapServiceRegistry, .BootstrapServiceRegistryBuilder, .StandardServiceRegistry, .StandardServiceRegistryBuilder, org.hibernate.boot.registry.selector.spi.StrategySelector, org.hibernate.boot.spi.MetadataImplementor, org.hibernate.cfg.AvailableSettings, org.hibernate.engine.config.spi.ConfigurationService, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.internal.log.DeprecationLogger, org.hibernate.service.ServiceRegistry, org.hibernate.tool.schema.TargetType, org.hibernate.tool.schema.internal.ExceptionHandlerCollectingImpl, .ExceptionHandlerHaltImpl, org.hibernate.tool.schema.spi.ExceptionHandler, .ExecutionOptions, .SchemaManagementTool, .SchemaManagementToolCoordinator, .TargetDescriptor

A commandline tool to update a database schema. May also be called from inside an application.
Authors
Christoph Sturm, Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private boolean
private String
private final List<Exception>
private boolean
pack-priv boolean
private static final CoreMessageLogger
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static MetadataImplementor
public static MetadataImplementor

Returns:

The built Metadata
buildMetadataFromMainArgs
(String[]
The "command line args"
args
)

Intended for test usage only.

private static StandardServiceRegistry
public void
execute(EnumSet<TargetType> targetTypes, Metadata metadata)

public void
execute(EnumSet<TargetType> targetTypes, Metadata metadata, ServiceRegistry serviceRegistry)

public List<E>

Returns:

A List containing the Exceptions occurred during the export
getExceptions
()

Returns a List of all Exceptions which occurred during the export.

public static void
main(String[] args)

public SchemaUpdate
setDelimiter(String
The delimiter
delimiter
)

Set the end of statement delimiter

public SchemaUpdate
setFormat(boolean format)

public SchemaUpdate
setHaltOnError(boolean haltOnError)

public SchemaUpdate
setOutputFile(String outputFile)

public SchemaUpdate

Returns:

this
setOverrideOutputFileContent
()

For generating a export script file, by default the content will be appended at the begin or end of the file.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

appendback to summary
private boolean append
delimiterback to summary
private String delimiter
exceptionsback to summary
private final List<Exception> exceptions
formatback to summary
private boolean format
haltOnErrorback to summary
pack-priv boolean haltOnError
LOGback to summary
private static final CoreMessageLogger LOG
outputFileback to summary
private String outputFile

Constructor Detail

SchemaUpdateback to summary
public SchemaUpdate()

Method Detail

buildMetadataback to summary
private static MetadataImplementor buildMetadata(SchemaUpdate.CommandLineArgs parsedArgs, ServiceRegistry serviceRegistry) throws Exception
buildMetadataFromMainArgsback to summary
public static MetadataImplementor buildMetadataFromMainArgs(String[] args) throws Exception

Intended for test usage only. Builds a Metadata using the same algorithm as main

Parameters
args:String[]

The "command line args"

Returns:MetadataImplementor

The built Metadata

Exceptions
Exception:
Problems building the Metadata
buildStandardServiceRegistryback to summary
private static StandardServiceRegistry buildStandardServiceRegistry(SchemaUpdate.CommandLineArgs parsedArgs) throws Exception
executeback to summary
public void execute(EnumSet<TargetType> targetTypes, Metadata metadata)
executeback to summary
public void execute(EnumSet<TargetType> targetTypes, Metadata metadata, ServiceRegistry serviceRegistry)
Annotations
@SuppressWarnings:unchecked
getExceptionsback to summary
public List<E> getExceptions()

Returns a List of all Exceptions which occurred during the export.

Returns:List<E>

A List containing the Exceptions occurred during the export

mainback to summary
public static void main(String[] args)
setDelimiterback to summary
public SchemaUpdate setDelimiter(String delimiter)

Set the end of statement delimiter

Parameters
delimiter:String

The delimiter

setFormatback to summary
public SchemaUpdate setFormat(boolean format)
setHaltOnErrorback to summary
public SchemaUpdate setHaltOnError(boolean haltOnError)
setOutputFileback to summary
public SchemaUpdate setOutputFile(String outputFile)
setOverrideOutputFileContentback to summary
public SchemaUpdate setOverrideOutputFileContent()

For generating a export script file, by default the content will be appended at the begin or end of the file. The sql will be written at the beginning of the file rather append to the end.

Returns:SchemaUpdate

this

org.hibernate.tool.hbm2ddl back to summary

private Class SchemaUpdate.CommandLineArgs

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv String
pack-priv String
pack-priv List<String>
pack-priv String
pack-priv List<String>
pack-priv String
pack-priv String
pack-priv String
pack-priv EnumSet<TargetType>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static SchemaUpdate.CommandLineArgs
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cfgXmlFileback to summary
pack-priv String cfgXmlFile
delimiterback to summary
pack-priv String delimiter
hbmXmlFilesback to summary
pack-priv List<String> hbmXmlFiles
implicitNamingStrategyImplNameback to summary
pack-priv String implicitNamingStrategyImplName
jarFilesback to summary
pack-priv List<String> jarFiles
outputFileback to summary
pack-priv String outputFile
physicalNamingStrategyImplNameback to summary
pack-priv String physicalNamingStrategyImplName
propertiesFileback to summary
pack-priv String propertiesFile
targetTypesback to summary
pack-priv EnumSet<TargetType> targetTypes

Constructor Detail

CommandLineArgsback to summary
private CommandLineArgs()

Method Detail

parseCommandLineArgsback to summary
public static SchemaUpdate.CommandLineArgs parseCommandLineArgs(String[] args)