Top Description Fields Constructors Methods
org.hibernate.tool.schema.internal.exec

public Class GenerationTargetToDatabase

extends Object
implements GenerationTarget
Class Inheritance
All Implemented Interfaces
org.hibernate.tool.schema.internal.exec.GenerationTarget
Imports
java.sql.Connection, .SQLException, .SQLWarning, .Statement, org.hibernate.engine.jdbc.internal.FormatStyle, org.hibernate.engine.jdbc.spi.SqlExceptionHelper, .SqlStatementLogger, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.resource.transaction.spi.DdlTransactionIsolator, org.hibernate.tool.schema.spi.CommandAcceptanceException, .ScriptSourceInput

A GenerationTarget which exports DDL directly to the database.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final boolean
private final DdlTransactionIsolator
private Statement
private static final CoreMessageLogger
private final boolean

Constructor Summary

AccessConstructor and Description
public
public
GenerationTargetToDatabase(DdlTransactionIsolator ddlTransactionIsolator, boolean releaseAfterUse)

public
GenerationTargetToDatabase(DdlTransactionIsolator ddlTransactionIsolator, boolean releaseAfterUse, boolean autocommit)

Method Summary

Modifier and TypeMethod and Description
public void
accept(String
The command
command
)

Implements org.hibernate.tool.schema.internal.exec.GenerationTarget.accept.

Accept a command
public void
beforeScript(ScriptSourceInput
The source for the script that is about to be executed.
scriptSource
)

Overrides default org.hibernate.tool.schema.internal.exec.GenerationTarget.beforeScript.

Called just before a script is executed using one or more calls to accept(String).
private Connection
private SqlExceptionHelper
private SqlStatementLogger
private Statement
public void
public void
release()

Implements org.hibernate.tool.schema.internal.exec.GenerationTarget.release.

Release this target, giving it a change to release its resources.
private static String
stripSql(SQLException e)

Strip repetition of the SQL statement from h2 messages.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

autocommitback to summary
private final boolean autocommit
ddlTransactionIsolatorback to summary
private final DdlTransactionIsolator ddlTransactionIsolator
jdbcStatementback to summary
private Statement jdbcStatement
logback to summary
private static final CoreMessageLogger log
releaseAfterUseback to summary
private final boolean releaseAfterUse

Constructor Detail

GenerationTargetToDatabaseback to summary
public GenerationTargetToDatabase(DdlTransactionIsolator ddlTransactionIsolator)
GenerationTargetToDatabaseback to summary
public GenerationTargetToDatabase(DdlTransactionIsolator ddlTransactionIsolator, boolean releaseAfterUse)
GenerationTargetToDatabaseback to summary
public GenerationTargetToDatabase(DdlTransactionIsolator ddlTransactionIsolator, boolean releaseAfterUse, boolean autocommit)

Method Detail

acceptback to summary
public void accept(String command)

Implements org.hibernate.tool.schema.internal.exec.GenerationTarget.accept.

Doc from org.hibernate.tool.schema.internal.exec.GenerationTarget.accept.

Accept a command

Parameters
command:String

The command

Annotations
@Override
beforeScriptback to summary
public void beforeScript(ScriptSourceInput scriptSource)

Overrides default org.hibernate.tool.schema.internal.exec.GenerationTarget.beforeScript.

Doc from org.hibernate.tool.schema.internal.exec.GenerationTarget.beforeScript.

Called just before a script is executed using one or more calls to accept(String).

May be used for logging in particular.

Parameters
scriptSource:ScriptSourceInput

The source for the script that is about to be executed.

Annotations
@Override
getIsolatedConnectionback to summary
private Connection getIsolatedConnection()
getSqlExceptionHelperback to summary
private SqlExceptionHelper getSqlExceptionHelper()
getSqlStatementLoggerback to summary
private SqlStatementLogger getSqlStatementLogger()
jdbcStatementback to summary
private Statement jdbcStatement()
prepareback to summary
public void prepare()

Implements org.hibernate.tool.schema.internal.exec.GenerationTarget.prepare.

Doc from org.hibernate.tool.schema.internal.exec.GenerationTarget.prepare.

Prepare for accepting actions

Annotations
@Override
releaseback to summary
public void release()

Implements org.hibernate.tool.schema.internal.exec.GenerationTarget.release.

Doc from org.hibernate.tool.schema.internal.exec.GenerationTarget.release.

Release this target, giving it a change to release its resources.

Annotations
@Override
stripSqlback to summary
private static String stripSql(SQLException e)

Strip repetition of the SQL statement from h2 messages.