org.hibernate.id.insert

Class AbstractReturningDelegate

Implemented Interfaces:
InsertGeneratedIdentifierDelegate
Known Direct Subclasses:
IdentityGenerator.GetGeneratedKeysDelegate, IdentityGenerator.InsertSelectDelegate, SequenceIdentityGenerator.Delegate

public abstract class AbstractReturningDelegate
extends java.lang.Object
implements InsertGeneratedIdentifierDelegate

Abstract InsertGeneratedIdentifierDelegate implementation where the underlying strategy causes the enerated identitifer to be returned as an effect of performing the insert statement. Thus, there is no need for an additional sql statement to determine the generated identitifer.
Author:
Steve Ebersole

Constructor Summary

AbstractReturningDelegate(PostInsertIdentityPersister persister)

Method Summary

protected abstract Serializable
executeAndExtract(PreparedStatement insert)
protected PostInsertIdentityPersister
getPersister()
Serializable
performInsert(String insertSQL, SessionImplementor session, Binder binder)
protected abstract PreparedStatement
prepare(String insertSQL, SessionImplementor session)
protected void
releaseStatement(PreparedStatement insert, SessionImplementor session)

Constructor Details

AbstractReturningDelegate

public AbstractReturningDelegate(PostInsertIdentityPersister persister)

Method Details

executeAndExtract

protected abstract Serializable executeAndExtract(PreparedStatement insert)
            throws SQLException

getPersister

protected PostInsertIdentityPersister getPersister()

performInsert

public final Serializable performInsert(String insertSQL,
                                        SessionImplementor session,
                                        Binder binder)
Specified by:
performInsert in interface InsertGeneratedIdentifierDelegate

prepare

protected abstract PreparedStatement prepare(String insertSQL,
                                             SessionImplementor session)
            throws SQLException

releaseStatement

protected void releaseStatement(PreparedStatement insert,
                                SessionImplementor session)
            throws SQLException