Top Description Fields Constructors Methods
org.hibernate.id.insert

public abstract Class AbstractSelectingDelegate

extends Object
implements InsertGeneratedIdentifierDelegate
Class Inheritance
All Implemented Interfaces
org.hibernate.id.insert.InsertGeneratedIdentifierDelegate
Known Direct Subclasses
org.hibernate.id.insert.BasicSelectingDelegate, org.hibernate.id.insert.UniqueKeySelectingDelegate
Imports
java.sql.PreparedStatement, .ResultSet, .SQLException, org.hibernate.engine.jdbc.mutation.JdbcValueBindings, org.hibernate.engine.jdbc.mutation.group.PreparedStatementDetails, org.hibernate.engine.jdbc.spi.JdbcCoordinator, .JdbcServices, .StatementPreparer, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.id.PostInsertIdentityPersister, org.hibernate.pretty.MessageHelper

Abstract InsertGeneratedIdentifierDelegate implementation where the underlying strategy requires a subsequent select after the insert to determine the generated identifier.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final PostInsertIdentityPersister

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected void
protected Object
extractGeneratedValue(ResultSet resultSet, SharedSessionContractImplementor session)

Extract the generated key value from the given result set after execution of getSelectSQL().

protected abstract String

Returns:

The SQL command string
getSelectSQL
()

Get the SQL statement to be used to retrieve generated key values.

public Object
performInsert(PreparedStatementDetails insertStatementDetails, JdbcValueBindings jdbcValueBindings, Object entity, SharedSessionContractImplementor session)

Implements org.hibernate.id.insert.InsertGeneratedIdentifierDelegate.performInsert.

Perform the insert and extract the database-generated primary key value.
public final Object
performInsert(String
The insert statement string
insertSQL
,
SharedSessionContractImplementor
The session in which we are operating
session
,
Binder
The parameter binder
binder
)

Implements org.hibernate.id.insert.InsertGeneratedIdentifierDelegate.performInsert.

Execute the given insert statement and return the generated key value.
public PreparedStatement
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

persisterback to summary
private final PostInsertIdentityPersister persister

Constructor Detail

AbstractSelectingDelegateback to summary
protected AbstractSelectingDelegate(PostInsertIdentityPersister persister)

Method Detail

bindParametersback to summary
protected void bindParameters(Object entity, PreparedStatement ps, SharedSessionContractImplementor session) throws SQLException
extractGeneratedValueback to summary
protected Object extractGeneratedValue(ResultSet resultSet, SharedSessionContractImplementor session) throws SQLException

Extract the generated key value from the given result set after execution of getSelectSQL().

getSelectSQLback to summary
protected abstract String getSelectSQL()

Get the SQL statement to be used to retrieve generated key values.

Returns:String

The SQL command string

performInsertback to summary
public Object performInsert(PreparedStatementDetails insertStatementDetails, JdbcValueBindings jdbcValueBindings, Object entity, SharedSessionContractImplementor session)

Implements org.hibernate.id.insert.InsertGeneratedIdentifierDelegate.performInsert.

Doc from org.hibernate.id.insert.InsertGeneratedIdentifierDelegate.performInsert.

Perform the insert and extract the database-generated primary key value.

Annotations
@Override
performInsertback to summary
public final Object performInsert(String insertSQL, SharedSessionContractImplementor session, Binder binder)

Implements org.hibernate.id.insert.InsertGeneratedIdentifierDelegate.performInsert.

Doc from org.hibernate.id.insert.InsertGeneratedIdentifierDelegate.performInsert.

Execute the given insert statement and return the generated key value.

Parameters
insertSQL:String

The insert statement string

session:SharedSessionContractImplementor

The session in which we are operating

binder:Binder

The parameter binder

Returns:Object

The generated identifier value

Annotations
@Override
prepareStatementback to summary
public PreparedStatement prepareStatement(String insertSql, SharedSessionContractImplementor session)

Implements org.hibernate.id.insert.InsertGeneratedIdentifierDelegate.prepareStatement.

Annotations
@Override