Top Description Fields Constructors Methods
org.hibernate.tool.hbm2ddl

public Class SchemaUpdate

extends Object
Class Inheritance
Imports
java.io.FileInputStream, .FileWriter, .Writer, java.sql.Connection, .SQLException, .Statement, java.util.ArrayList, .List, .Properties, org.hibernate.HibernateException, .JDBCException, org.hibernate.cfg.Configuration, .Environment, .NamingStrategy, .Settings, org.hibernate.dialect.Dialect, org.hibernate.jdbc.util.FormatStyle, .Formatter, .SQLStatementLogger, org.hibernate.util.PropertiesHelper, .ReflectHelper, org.slf4j.Logger, .LoggerFactory

A commandline tool to update a database schema. May also be called from inside an application.
Author
Christoph Sturm

Field Summary

Modifier and TypeField and Description
private Configuration
private ConnectionHelper
private String
private Dialect
private List<E>
private boolean
private Formatter
private boolean
private static final Logger
private String
private SQLStatementLogger

Constructor Summary

AccessConstructor and Description
public
public
SchemaUpdate(Configuration cfg, Properties connectionProperties)

public

Method Summary

Modifier and TypeMethod and Description
public void
execute(boolean
print all DDL to the console
script
,
boolean doUpdate)

Execute the schema updates

public List<E>

Returns:

A List containig the Exceptions occured during the export
getExceptions
()

Returns a List of all Exceptions which occured during the export.

public static void
main(String[] args)

public void
setDelimiter(String delimiter)

public void
setFormat(boolean format)

public void
setHaltOnError(boolean haltOnError)

public void
setOutputFile(String outputFile)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

configurationback to summary
private Configuration configuration
connectionHelperback to summary
private ConnectionHelper connectionHelper
delimiterback to summary
private String delimiter
dialectback to summary
private Dialect dialect
exceptionsback to summary
private List<E> exceptions
formatback to summary
private boolean format
formatterback to summary
private Formatter formatter
haltOnErrorback to summary
private boolean haltOnError
logback to summary
private static final Logger log
outputFileback to summary
private String outputFile
sqlStatementLoggerback to summary
private SQLStatementLogger sqlStatementLogger

Constructor Detail

SchemaUpdateback to summary
public SchemaUpdate(Configuration cfg) throws HibernateException
SchemaUpdateback to summary
public SchemaUpdate(Configuration cfg, Properties connectionProperties) throws HibernateException
SchemaUpdateback to summary
public SchemaUpdate(Configuration cfg, Settings settings) throws HibernateException

Method Detail

executeback to summary
public void execute(boolean script, boolean doUpdate)

Execute the schema updates

Parameters
script:boolean

print all DDL to the console

getExceptionsback to summary
public List<E> getExceptions()

Returns a List of all Exceptions which occured during the export.

Returns:List<E>

A List containig the Exceptions occured during the export

mainback to summary
public static void main(String[] args)
setDelimiterback to summary
public void setDelimiter(String delimiter)
setFormatback to summary
public void setFormat(boolean format)
setHaltOnErrorback to summary
public void setHaltOnError(boolean haltOnError)
setOutputFileback to summary
public void setOutputFile(String outputFile)