|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.tool.hbm2ddl.SchemaExport
public class SchemaExport
Commandline tool to export table schema to the database. This class may also be called from inside an application.
Nested Class Summary | |
---|---|
static class |
SchemaExport.Type
|
Constructor Summary | |
---|---|
SchemaExport(Configuration configuration)
Create a schema exporter for the given Configuration |
|
SchemaExport(Configuration configuration,
Connection connection)
Create a schema exporter for the given Configuration, using the supplied connection for connectivity. |
|
SchemaExport(Configuration configuration,
Properties properties)
Deprecated. properties may be specified via the Configuration object |
|
SchemaExport(ConnectionHelper connectionHelper,
String[] dropSql,
String[] createSql)
|
|
SchemaExport(MetadataImplementor metadata)
|
|
SchemaExport(ServiceRegistry serviceRegistry,
Configuration configuration)
|
Method Summary | |
---|---|
void |
create(boolean script,
boolean export)
Run the schema creation script; drop script is automatically executed before running the creation script. |
void |
create(Target output)
Run the schema creation script; drop script is automatically executed before running the creation script. |
void |
drop(boolean script,
boolean export)
Run the drop schema script. |
void |
drop(Target output)
|
void |
execute(boolean script,
boolean export,
boolean justDrop,
boolean justCreate)
|
void |
execute(Target output,
SchemaExport.Type type)
|
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 |
setImportSqlCommandExtractor(ImportSqlCommandExtractor importSqlCommandExtractor)
Set import.sql command extractor. |
SchemaExport |
setOutputFile(String filename)
For generating a export script file, this is the file which will be written. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SchemaExport(ServiceRegistry serviceRegistry, Configuration configuration)
public SchemaExport(MetadataImplementor metadata)
public SchemaExport(Configuration configuration)
configuration
- The configuration from which to build a schema export.
HibernateException
- Indicates problem preparing for schema export.@Deprecated public SchemaExport(Configuration configuration, Properties properties) throws HibernateException
configuration
- 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 configuration, Connection connection) throws HibernateException
configuration
- The configuration to use.connection
- The JDBC connection to use.
HibernateException
- Indicates problem preparing for schema export.public SchemaExport(ConnectionHelper connectionHelper, String[] dropSql, String[] createSql)
Method Detail |
---|
public SchemaExport setOutputFile(String filename)
filename
- The name of the file to which to write the export script.
public SchemaExport setDelimiter(String delimiter)
delimiter
- The delimiter
public SchemaExport setFormat(boolean format)
format
- Should we format SQL strings
public SchemaExport setImportSqlCommandExtractor(ImportSqlCommandExtractor importSqlCommandExtractor)
SingleLineSqlCommandExtractor
is used.
importSqlCommandExtractor
- import.sql command extractor.
public 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 create(Target output)
output
- the target of the script.public void drop(boolean script, boolean export)
script
- print the DDL to the consoleexport
- export the script to the databasepublic void drop(Target output)
public void execute(boolean script, boolean export, boolean justDrop, boolean justCreate)
public void execute(Target output, SchemaExport.Type type)
public static void main(String[] args)
public List getExceptions()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |