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.IdentityGenerator.BasicDelegate, org.hibernate.id.SelectGenerator.SelectGeneratorDelegate
Imports
org.hibernate.exception.JDBCExceptionHelper, org.hibernate.pretty.MessageHelper, org.hibernate.engine.SessionImplementor, org.hibernate.id.PostInsertIdentityPersister, java.sql.PreparedStatement, .SQLException, .ResultSet, java.io.Serializable

Abstract InsertGeneratedIdentifierDelegate implementation where the underlying strategy requires an 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
bindParameters(SessionImplementor
The session
session
,
PreparedStatement
The prepared SQL command
ps
,
Object
The entity being saved.
entity
)

Bind any required parameter values into the SQL command getSelectSQL.

protected abstract Serializable

Returns:

The generated identifier
getResult
(SessionImplementor
The session
session
,
ResultSet
The result set containing the generated primay key values.
rs
,
Object
The entity being saved.
entity
)

Extract the generated key value from the given result set.

protected abstract String

Returns:

The SQL command string
getSelectSQL
()

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

public final Serializable
performInsert(String
The INSERT statement string
insertSQL
,
SessionImplementor
The session in which we are operating
session
,
Binder
The param binder
binder
)

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

Perform the indicated insert SQL statement and determine the identifier value generated.
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(SessionImplementor session, PreparedStatement ps, Object entity) throws SQLException

Bind any required parameter values into the SQL command getSelectSQL.

Parameters
session:SessionImplementor

The session

ps:PreparedStatement

The prepared SQL command

entity:Object

The entity being saved.

getResultback to summary
protected abstract Serializable getResult(SessionImplementor session, ResultSet rs, Object entity) throws SQLException

Extract the generated key value from the given result set.

Parameters
session:SessionImplementor

The session

rs:ResultSet

The result set containing the generated primay key values.

entity:Object

The entity being saved.

Returns:Serializable

The generated identifier

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 final Serializable performInsert(String insertSQL, SessionImplementor session, Binder binder)

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

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

Perform the indicated insert SQL statement and determine the identifier value generated.

Parameters
insertSQL:String

The INSERT statement string

session:SessionImplementor

The session in which we are operating

binder:Binder

The param binder

Returns:Serializable

The generated identifier value.