站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 3.2.4 正式版 API 英文文档

SchemaExport (Hibernate API Documentation) - Hibernate 3.2.4 正式版 API 英文文档


org.hibernate.tool.hbm2ddl
Class SchemaExport

java.lang.Object
  extended byorg.hibernate.tool.hbm2ddl.SchemaExport

public class SchemaExport
extends Object

Commandline tool to export table schema to the database. This class may also be called from inside an application.

Author:
Daniel Bradby, Gavin King

Constructor Summary
SchemaExport(Configuration cfg)
          Create a schema exporter for the given Configuration
SchemaExport(Configuration cfg, Connection connection)
           
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
 
Method Summary
 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)
           
 SchemaExport setHaltOnError(boolean haltOnError)
           
 SchemaExport setImportFile(String filename)
           
 SchemaExport setOutputFile(String filename)
          Set an output filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaExport

public SchemaExport(Configuration cfg)
             throws HibernateException
Create a schema exporter for the given Configuration


SchemaExport

public SchemaExport(Configuration cfg,
                    Settings settings)
             throws HibernateException
Create a schema exporter for the given Configuration and given settings


SchemaExport

public SchemaExport(Configuration cfg,
                    Properties properties)
             throws HibernateException
Deprecated. properties may be specified via the Configuration object

Create a schema exporter for the given Configuration, with the given database connection properties.


SchemaExport

public SchemaExport(Configuration cfg,
                    Connection connection)
Method Detail

setOutputFile

public SchemaExport setOutputFile(String filename)
Set an output filename. The generated script will be written to this file.


setImportFile

public SchemaExport setImportFile(String filename)

setDelimiter

public SchemaExport setDelimiter(String delimiter)
Set the end of statement delimiter


create

public void create(boolean script,
                   boolean export)
Run the schema creation script.

Parameters:
script - print the DDL to the console
export - export the script to the database

drop

public void drop(boolean script,
                 boolean export)
Run the drop schema script.

Parameters:
script - print the DDL to the console
export - export the script to the database

execute

public void execute(boolean script,
                    boolean export,
                    boolean justDrop,
                    boolean justCreate)

main

public static void main(String[] args)

getExceptions

public List getExceptions()
Returns a List of all Exceptions which occured during the export.

Returns:
A List containig the Exceptions occured during the export

setFormat

public SchemaExport setFormat(boolean format)

setHaltOnError

public SchemaExport setHaltOnError(boolean haltOnError)