public class SchemaExport extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SchemaExport.Type |
Constructor and Description |
---|
SchemaExport(Configuration configuration)
Deprecated.
Use one of the forms accepting
MetadataImplementor , rather
than Configuration , instead. |
SchemaExport(Configuration configuration,
Connection connection)
Deprecated.
Use one of the forms accepting
MetadataImplementor , rather
than Configuration , instead. |
SchemaExport(ConnectionHelper connectionHelper,
MetadataImplementor metadata)
Intended for testing use
|
SchemaExport(ConnectionHelper connectionHelper,
String[] dropSql,
String[] createSql) |
SchemaExport(MetadataImplementor metadata)
Builds a SchemaExport object.
|
SchemaExport(MetadataImplementor metadata,
boolean createNamespaces)
Builds a SchemaExport object.
|
SchemaExport(MetadataImplementor metadata,
Connection connection)
Create a SchemaExport for the given Metadata, using the supplied connection for connectivity.
|
SchemaExport(ServiceRegistry serviceRegistry,
Configuration configuration)
Deprecated.
Use one of the forms accepting
MetadataImplementor , rather
than Configuration , instead. |
SchemaExport(ServiceRegistry serviceRegistry,
MetadataImplementor metadata)
Builds a SchemaExport object.
|
SchemaExport(ServiceRegistry serviceRegistry,
MetadataImplementor metadata,
boolean createNamespaces)
Builds a SchemaExport object.
|
Modifier and Type | Method and Description |
---|---|
static MetadataImplementor |
buildMetadataFromMainArgs(String[] args)
Intended for test usage only.
|
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.
|
public SchemaExport(MetadataImplementor metadata)
metadata
- The metadata object holding the mapping info to be exportedpublic SchemaExport(MetadataImplementor metadata, boolean createNamespaces)
metadata
- The metadata object holding the mapping info to be exportedpublic SchemaExport(ServiceRegistry serviceRegistry, MetadataImplementor metadata)
serviceRegistry
- The registry of services available for use. Should, at a minimum, contain
the JdbcServices service.metadata
- The metadata object holding the mapping info to be exportedpublic SchemaExport(ServiceRegistry serviceRegistry, MetadataImplementor metadata, boolean createNamespaces)
serviceRegistry
- The registry of services available for use. Should, at a minimum, contain
the JdbcServices service.metadata
- The metadata object holding the mapping info to be exportedpublic SchemaExport(ConnectionHelper connectionHelper, MetadataImplementor metadata)
connectionHelper
- Access to the JDBC Connectionmetadata
- The metadata object holding the mapping info to be exportedpublic SchemaExport(MetadataImplementor metadata, Connection connection) throws HibernateException
metadata
- The metadata object holding the mapping info to be exportedconnection
- The JDBC connection to use.HibernateException
- Indicates problem preparing for schema export.@Deprecated public SchemaExport(ServiceRegistry serviceRegistry, Configuration configuration)
MetadataImplementor
, rather
than Configuration
, instead.@Deprecated public SchemaExport(Configuration configuration)
MetadataImplementor
, rather
than Configuration
, instead.@Deprecated public SchemaExport(Configuration configuration, Connection connection) throws HibernateException
MetadataImplementor
, rather
than Configuration
, instead.HibernateException
public SchemaExport(ConnectionHelper connectionHelper, String[] dropSql, String[] createSql)
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 delimiterpublic SchemaExport setFormat(boolean format)
format
- Should we format SQL stringspublic 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 static MetadataImplementor buildMetadataFromMainArgs(String[] args) throws Exception
main(java.lang.String[])
args
- The "command line args"Exception
- Problems building the Metadatapublic List getExceptions()
Copyright © 2001-2017 Red Hat, Inc. All Rights Reserved.