public class SchemaExport extends Object
Constructor and Description |
---|
SchemaExport(Configuration cfg)
Create a schema exporter for the given Configuration
|
SchemaExport(Configuration cfg,
Connection connection)
Create a schema exporter for the given Configuration, using the supplied connection for connectivity.
|
SchemaExport(Configuration cfg,
Properties properties)
Deprecated.
properties may be specified via the Configuration object
|
SchemaExport(Configuration cfg,
Settings settings)
Create a schema exporter for the given Configuration and given settings
|
Modifier and Type | Method and Description |
---|---|
void |
create(boolean script,
boolean export)
Run the schema creation script.
|
void |
drop(boolean script,
boolean export)
Run the drop schema script.
|
void |
execute(boolean script,
boolean export,
boolean justDrop,
boolean justCreate) |
List |
getExceptions()
Returns a List of all Exceptions which occured during the export.
|
static void |
main(String[] args) |
SchemaExport |
setDelimiter(String delimiter)
Set the end of statement delimiter
|
SchemaExport |
setFormat(boolean format)
Should we format the sql strings?
|
SchemaExport |
setHaltOnError(boolean haltOnError)
Should we stop once an error occurs?
|
SchemaExport |
setImportFile(String filename)
Deprecated.
use
org.hibernate.cfg.Environment.HBM2DDL_IMPORT_FILE |
SchemaExport |
setOutputFile(String filename)
For generating a export script file, this is the file which will be written.
|
public SchemaExport(Configuration cfg) throws HibernateException
cfg
- The configuration from which to build a schema export.HibernateException
- Indicates problem preparing for schema export.public SchemaExport(Configuration cfg, Settings settings) throws HibernateException
cfg
- The configuration from which to build a schema export.settings
- The 'parsed' settings.HibernateException
- Indicates problem preparing for schema export.public SchemaExport(Configuration cfg, Properties properties) throws HibernateException
cfg
- The configuration from which to build a schema export.properties
- The properties from which to configure connectivity etc.HibernateException
- Indicates problem preparing for schema export.public SchemaExport(Configuration cfg, Connection connection) throws HibernateException
cfg
- The configuration to use.connection
- The JDBC connection to use.HibernateException
- Indicates problem preparing for schema export.public SchemaExport setOutputFile(String filename)
filename
- The name of the file to which to write the export script.public SchemaExport setImportFile(String filename)
org.hibernate.cfg.Environment.HBM2DDL_IMPORT_FILE
filename
- The import file name.public SchemaExport setDelimiter(String delimiter)
delimiter
- The delimiterpublic SchemaExport setFormat(boolean format)
format
- Should we format SQL stringspublic SchemaExport setHaltOnError(boolean haltOnError)
haltOnError
- True if export should stop after error.public void create(boolean script, boolean export)
script
- print the DDL to the consoleexport
- export the script to the databasepublic void drop(boolean script, boolean export)
script
- print the DDL to the consoleexport
- export the script to the databasepublic void execute(boolean script, boolean export, boolean justDrop, boolean justCreate)
public static void main(String[] args)
public List getExceptions()
Copyright © 2002-2017 Red Hat Middleware, LLC. All Rights Reserved