public class SchemaUpdate extends Object
Constructor and Description |
---|
SchemaUpdate(MetadataImplementor metadata)
Creates a SchemaUpdate object.
|
SchemaUpdate(ServiceRegistry serviceRegistry,
MetadataImplementor metadata)
Creates a SchemaUpdate object.
|
Modifier and Type | Method and Description |
---|---|
static MetadataImplementor |
buildMetadataFromMainArgs(String[] args)
Intended for test usage only.
|
void |
execute(boolean script,
boolean doUpdate)
Execute the schema updates
|
void |
execute(Target target) |
List |
getExceptions()
Returns a List of all Exceptions which occured during the export.
|
static void |
main(String[] args) |
void |
setDelimiter(String delimiter)
Set the end of statement delimiter
|
void |
setFormat(boolean format) |
void |
setHaltOnError(boolean haltOnError) |
void |
setOutputFile(String outputFile) |
public SchemaUpdate(MetadataImplementor metadata)
metadata
- The metadata defining the schema as it should be after updateHibernateException
public SchemaUpdate(ServiceRegistry serviceRegistry, MetadataImplementor metadata) throws HibernateException
hibernate.hbm2ddl.auto
handling, generally from within the SessionFactory
ctor.
Note that the passed ServiceRegistry is expected to be of type
SessionFactoryServiceRegistry
, although
any ServiceRegistry type will work as long as it has access to the
JdbcServices
service.serviceRegistry
- The ServiceRegistry to use.metadata
- The metadata defining the schema as it should be after updateHibernateException
public void execute(boolean script, boolean doUpdate)
script
- print all DDL to the consolepublic void execute(Target target)
public List getExceptions()
public void setHaltOnError(boolean haltOnError)
public void setFormat(boolean format)
public void setOutputFile(String outputFile)
public void setDelimiter(String delimiter)
delimiter
- The delimiterpublic static void main(String[] args)
public static MetadataImplementor buildMetadataFromMainArgs(String[] args) throws Exception
main(java.lang.String[])
args
- The "command line args"Exception
- Problems building the MetadataCopyright © 2001-2017 Red Hat, Inc. All Rights Reserved.