Package org.hibernate.tool.hbm2ddl
Class SchemaUpdate
java.lang.Object
org.hibernate.tool.hbm2ddl.SchemaUpdate
A commandline tool to update a database schema. May also be called from inside an application.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.hibernate.boot.spi.MetadataImplementor
buildMetadataFromMainArgs
(String[] args) Intended for test usage only.void
execute
(EnumSet<org.hibernate.tool.schema.TargetType> targetTypes, org.hibernate.boot.Metadata metadata) void
execute
(EnumSet<org.hibernate.tool.schema.TargetType> targetTypes, org.hibernate.boot.Metadata metadata, org.hibernate.service.ServiceRegistry serviceRegistry) Returns a List of all Exceptions which occurred during the export.static void
setDelimiter
(String delimiter) Set the end of statement delimitersetFormat
(boolean format) setHaltOnError
(boolean haltOnError) setOutputFile
(String outputFile) For generating a export script file, by default the content will be appended at the begin or end of the file.
-
Constructor Details
-
SchemaUpdate
public SchemaUpdate()
-
-
Method Details
-
execute
public void execute(EnumSet<org.hibernate.tool.schema.TargetType> targetTypes, org.hibernate.boot.Metadata metadata) -
execute
public void execute(EnumSet<org.hibernate.tool.schema.TargetType> targetTypes, org.hibernate.boot.Metadata metadata, org.hibernate.service.ServiceRegistry serviceRegistry) -
getExceptions
Returns a List of all Exceptions which occurred during the export.- Returns:
- A List containing the Exceptions occurred during the export
-
setHaltOnError
-
setFormat
-
setOutputFile
-
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:
- this
-
setDelimiter
Set the end of statement delimiter- Parameters:
delimiter
- The delimiter
-
main
-
buildMetadataFromMainArgs
public static org.hibernate.boot.spi.MetadataImplementor buildMetadataFromMainArgs(String[] args) throws Exception Intended for test usage only. Builds a Metadata using the same algorithm asmain(java.lang.String[])
- Parameters:
args
- The "command line args"- Returns:
- The built Metadata
- Throws:
Exception
- Problems building the Metadata
-