public abstract class AbstractSelectingDelegate extends Object implements InsertGeneratedIdentifierDelegate
Abstract InsertGeneratedIdentifierDelegate implementation where the underlying strategy requires an subsequent select after the insert to determine the generated identifier.
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSelectingDelegate(PostInsertIdentityPersister persister) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
bindParameters(SharedSessionContractImplementor session,
PreparedStatement ps,
Object entity)
Bind any required parameter values into the SQL command
getSelectSQL(). |
protected abstract Serializable |
getResult(SharedSessionContractImplementor session,
ResultSet rs,
Object entity)
Extract the generated key value from the given result set.
|
protected abstract String |
getSelectSQL()
Get the SQL statement to be used to retrieve generated key values.
|
Serializable |
performInsert(String insertSQL,
SharedSessionContractImplementor session,
Binder binder)
Perform the indicated insert SQL statement and determine the identifier value
generated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprepareIdentifierGeneratingInsertprotected AbstractSelectingDelegate(PostInsertIdentityPersister persister)
public final Serializable performInsert(String insertSQL, SharedSessionContractImplementor session, Binder binder)
InsertGeneratedIdentifierDelegatePerform the indicated insert SQL statement and determine the identifier value generated.
performInsert in interface InsertGeneratedIdentifierDelegateinsertSQL - The INSERT statement stringsession - The session in which we are operatingbinder - The param binderprotected abstract String getSelectSQL()
Get the SQL statement to be used to retrieve generated key values.
protected void bindParameters(SharedSessionContractImplementor session, PreparedStatement ps, Object entity) throws SQLException
Bind any required parameter values into the SQL command getSelectSQL().
session - The sessionps - The prepared SQL commandentity - The entity being saved.SQLExceptionprotected abstract Serializable getResult(SharedSessionContractImplementor session, ResultSet rs, Object entity) throws SQLException
Extract the generated key value from the given result set.
session - The sessionrs - The result set containing the generated primay key values.entity - The entity being saved.SQLExceptionCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.