org.hibernate.tool.hbm2ddl
Class SchemaExport
java.lang.Object
org.hibernate.tool.hbm2ddl.SchemaExport
public class SchemaExport
extends java.lang.Object
Commandline tool to export table schema to the database. This class may also be called from inside an application.
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) - An import file, containing raw SQL statements to be executed.
|
SchemaExport | setOutputFile(String filename) - For generating a export script file, this is the file which will be written.
|
SchemaExport
public SchemaExport(Configuration cfg)
throws HibernateException
Create a schema exporter for the given Configuration
cfg
- The configuration from which to build a schema export.
SchemaExport
public SchemaExport(Configuration cfg,
Connection connection)
throws HibernateException
Create a schema exporter for the given Configuration, using the supplied connection for connectivity.
cfg
- The configuration to use.connection
- The JDBC connection to use.
SchemaExport
public SchemaExport(Configuration cfg,
Properties properties)
throws HibernateException
properties may be specified via the Configuration object
Create a schema exporter for the given Configuration, with the given
database connection properties.
cfg
- The configuration from which to build a schema export.properties
- The properties from which to configure connectivity etc.
SchemaExport
public SchemaExport(Configuration cfg,
Settings settings)
throws HibernateException
Create a schema exporter for the given Configuration and given settings
cfg
- The configuration from which to build a schema export.settings
- The 'parsed' settings.
create
public void create(boolean script,
boolean export)
Run the schema creation script.
script
- print the DDL to the consoleexport
- export the script to the database
drop
public void drop(boolean script,
boolean export)
Run the drop schema script.
script
- print the DDL to the consoleexport
- export the script to the database
execute
public void execute(boolean script,
boolean export,
boolean justDrop,
boolean justCreate)
getExceptions
public List getExceptions()
Returns a List of all Exceptions which occured during the export.
- A List containig the Exceptions occured during the export
main
public static void main(String[] args)
setDelimiter
public SchemaExport setDelimiter(String delimiter)
Set the end of statement delimiter
delimiter
- The delimiter
setFormat
public SchemaExport setFormat(boolean format)
Should we format the sql strings?
format
- Should we format SQL strings
setHaltOnError
public SchemaExport setHaltOnError(boolean haltOnError)
Should we stop once an error occurs?
haltOnError
- True if export should stop after error.
setImportFile
public SchemaExport setImportFile(String filename)
An import file, containing raw SQL statements to be executed.
filename
- The import file name.
setOutputFile
public SchemaExport setOutputFile(String filename)
For generating a export script file, this is the file which will be written.
filename
- The name of the file to which to write the export script.