public abstract class

AbstractSelectingDelegate

extends Object
implements InsertGeneratedIdentifierDelegate
java.lang.Object
   ↳ org.hibernate.id.insert.AbstractSelectingDelegate
Known Direct Subclasses

Class Overview

Abstract InsertGeneratedIdentifierDelegate implementation where the underlying strategy requires an subsequent select after the insert to determine the generated identifier.

Summary

Protected Constructors
AbstractSelectingDelegate(PostInsertIdentityPersister persister)
Public Methods
final Serializable performInsert(String insertSQL, SessionImplementor session, Binder binder)
Perform the indicated insert SQL statement and determine the identifier value generated.
Protected Methods
void bindParameters(SessionImplementor session, PreparedStatement ps, Object entity)
Bind any required parameter values into the SQL command getSelectSQL().
abstract Serializable getResult(SessionImplementor session, ResultSet rs, Object entity)
Extract the generated key value from the given result set.
abstract String getSelectSQL()
Get the SQL statement to be used to retrieve generated key values.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.hibernate.id.insert.InsertGeneratedIdentifierDelegate

Protected Constructors

protected AbstractSelectingDelegate (PostInsertIdentityPersister persister)

Public Methods

public final Serializable performInsert (String insertSQL, SessionImplementor session, Binder binder)

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

Parameters
insertSQL The INSERT statement string
session The session in which we are operating
binder The param binder
Returns
  • The generated identifier value.

Protected Methods

protected void bindParameters (SessionImplementor session, PreparedStatement ps, Object entity)

Bind any required parameter values into the SQL command getSelectSQL().

Parameters
session The session
ps The prepared SQL command
entity The entity being saved.
Throws
SQLException

protected abstract Serializable getResult (SessionImplementor session, ResultSet rs, Object entity)

Extract the generated key value from the given result set.

Parameters
session The session
rs The result set containing the generated primay key values.
entity The entity being saved.
Returns
  • The generated identifier
Throws
SQLException

protected abstract String getSelectSQL ()

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

Returns
  • The SQL command string