public class SchemaExport
extends java.lang.Object
| Constructor and Description |
|---|
SchemaExport(Configuration cfg)
Create a schema exporter for the given Configuration
|
SchemaExport(Configuration cfg,
java.sql.Connection connection)
Create a schema exporter for the given Configuration, using the supplied connection for connectivity.
|
SchemaExport(Configuration cfg,
java.util.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) |
java.util.List |
getExceptions()
Returns a List of all Exceptions which occured during the export.
|
static void |
main(java.lang.String[] args) |
SchemaExport |
setDelimiter(java.lang.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(java.lang.String filename)
Deprecated.
use
org.hibernate.cfg.Environment.HBM2DDL_IMPORT_FILE |
SchemaExport |
setOutputFile(java.lang.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, java.util.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, java.sql.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(java.lang.String filename)
filename - The name of the file to which to write the export script.public SchemaExport setImportFile(java.lang.String filename)
org.hibernate.cfg.Environment.HBM2DDL_IMPORT_FILEfilename - The import file name.public SchemaExport setDelimiter(java.lang.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(java.lang.String[] args)
public java.util.List getExceptions()
Copyright © 2013. All Rights Reserved.