Top Inners Fields Constructors Methods
org.hibernate.engine.jdbc.internal

public Class MutationStatementPreparerImpl

extends Object
implements MutationStatementPreparer
Class Inheritance
All Implemented Interfaces
org.hibernate.engine.jdbc.spi.MutationStatementPreparer
Imports
java.sql.Connection, .PreparedStatement, .SQLException, org.hibernate.AssertionFailure, org.hibernate.engine.jdbc.spi.JdbcServices, .MutationStatementPreparer, .SqlExceptionHelper, org.hibernate.event.spi.EventManager, .HibernateMonitoringEvent, org.hibernate.resource.jdbc.spi.JdbcObserver, .JdbcSessionContext, .JdbcSessionOwner, .LogicalConnectionImplementor

Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
private abstract class

Field Summary

Modifier and TypeField and Description
private final JdbcCoordinatorImpl
private final JdbcServices

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private MutationStatementPreparerImpl.StatementPreparationTemplate
buildPreparedStatementPreparationTemplate(String sql, final boolean isCallable)

private void
protected final Connection
protected final LogicalConnectionImplementor
public PreparedStatement
prepareStatement(String
The SQL the statement to be prepared
sql
,
boolean
Whether to prepare as a callable statement.
isCallable
)

Implements org.hibernate.engine.jdbc.spi.MutationStatementPreparer.prepareStatement.

Prepare a statement.
public PreparedStatement
prepareStatement(String
The INSERT SQL
sql
,
int
The autoGeneratedKeys flag
autoGeneratedKeys
)

Implements org.hibernate.engine.jdbc.spi.MutationStatementPreparer.prepareStatement.

Prepare an INSERT statement, specifying how auto-generated (by the database) keys should be handled.
public PreparedStatement
prepareStatement(String
- the SQL for the statement to be prepared
sql
,
String[]
The name of the columns to be returned in the generated keys result set.
columnNames
)

Implements org.hibernate.engine.jdbc.spi.MutationStatementPreparer.prepareStatement.

Prepare an INSERT statement, specifying columns which are auto-generated values to be returned.
protected final JdbcSessionContext
protected final SqlExceptionHelper
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

jdbcCoordinatorback to summary
private final JdbcCoordinatorImpl jdbcCoordinator
jdbcServicesback to summary
private final JdbcServices jdbcServices

Constructor Detail

MutationStatementPreparerImplback to summary
public MutationStatementPreparerImpl(JdbcCoordinatorImpl jdbcCoordinator, JdbcServices jdbcServices)

Method Detail

buildPreparedStatementPreparationTemplateback to summary
private MutationStatementPreparerImpl.StatementPreparationTemplate buildPreparedStatementPreparationTemplate(String sql, final boolean isCallable)
checkAutoGeneratedKeysSupportEnabledback to summary
private void checkAutoGeneratedKeysSupportEnabled()
connectionback to summary
protected final Connection connection()
logicalConnectionback to summary
protected final LogicalConnectionImplementor logicalConnection()
prepareStatementback to summary
public PreparedStatement prepareStatement(String sql, boolean isCallable)

Implements org.hibernate.engine.jdbc.spi.MutationStatementPreparer.prepareStatement.

Doc from org.hibernate.engine.jdbc.spi.MutationStatementPreparer.prepareStatement.

Prepare a statement.

Parameters
sql:String

The SQL the statement to be prepared

isCallable:boolean

Whether to prepare as a callable statement.

Returns:PreparedStatement

the prepared statement

Annotations
@Override
prepareStatementback to summary
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)

Implements org.hibernate.engine.jdbc.spi.MutationStatementPreparer.prepareStatement.

Doc from org.hibernate.engine.jdbc.spi.MutationStatementPreparer.prepareStatement.

Prepare an INSERT statement, specifying how auto-generated (by the database) keys should be handled. Really this is a boolean, but JDBC opted to define it instead using 2 int constants:

Generated keys are accessed afterwards via PreparedStatement#getGeneratedKeys

Parameters
sql:String

The INSERT SQL

autoGeneratedKeys:int

The autoGeneratedKeys flag

Returns:PreparedStatement

the prepared statement

Annotations
@Override
prepareStatementback to summary
public PreparedStatement prepareStatement(String sql, String[] columnNames)

Implements org.hibernate.engine.jdbc.spi.MutationStatementPreparer.prepareStatement.

Doc from org.hibernate.engine.jdbc.spi.MutationStatementPreparer.prepareStatement.

Prepare an INSERT statement, specifying columns which are auto-generated values to be returned. Generated keys are accessed afterwards via PreparedStatement#getGeneratedKeys

Parameters
sql:String

- the SQL for the statement to be prepared

columnNames:String[]

The name of the columns to be returned in the generated keys result set.

Returns:PreparedStatement

the prepared statement

Annotations
@Override
settingsback to summary
protected final JdbcSessionContext settings()
sqlExceptionHelperback to summary
protected final SqlExceptionHelper sqlExceptionHelper()
org.hibernate.engine.jdbc.internal back to summary

private abstract Class MutationStatementPreparerImpl.StatementPreparationTemplate

extends Object
Class Inheritance
  • java.lang.Object
  • org.hibernate.engine.jdbc.internal.MutationStatementPreparerImpl.StatementPreparationTemplate

Field Summary

Modifier and TypeField and Description
protected final String

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected abstract PreparedStatement
public void
postProcess(PreparedStatement preparedStatement)

public PreparedStatement
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

sqlback to summary
protected final String sql

Constructor Detail

StatementPreparationTemplateback to summary
protected StatementPreparationTemplate(String incomingSql)

Method Detail

doPrepareback to summary
protected abstract PreparedStatement doPrepare() throws SQLException
postProcessback to summary
public void postProcess(PreparedStatement preparedStatement) throws SQLException
prepareStatementback to summary
public PreparedStatement prepareStatement()
setStatementTimeoutback to summary
private void setStatementTimeout(PreparedStatement preparedStatement) throws SQLException