Package org.hibernate.id.insert
Class AbstractSelectingDelegate
- java.lang.Object
-
- org.hibernate.id.insert.AbstractSelectingDelegate
-
- All Implemented Interfaces:
InsertGeneratedIdentifierDelegate
- Direct Known Subclasses:
IdentityGenerator.BasicDelegate,SelectGenerator.SelectGeneratorDelegate
public abstract class AbstractSelectingDelegate extends Object implements InsertGeneratedIdentifierDelegate
Abstract InsertGeneratedIdentifierDelegate implementation where the underlying strategy requires a subsequent select after the insert to determine the generated identifier.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSelectingDelegate(PostInsertIdentityPersister persister)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidbindParameters(SharedSessionContractImplementor session, PreparedStatement ps, Object entity)Bind any required parameter values into the SQL commandgetSelectSQL().protected abstract SerializablegetResult(SharedSessionContractImplementor session, ResultSet rs, Object entity)Extract the generated key value from the given result set.protected abstract StringgetSelectSQL()Get the SQL statement to be used to retrieve generated key values.SerializableperformInsert(String insertSQL, SharedSessionContractImplementor session, Binder binder)Perform the indicated insert SQL statement and determine the identifier value generated.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.id.insert.InsertGeneratedIdentifierDelegate
prepareIdentifierGeneratingInsert, prepareIdentifierGeneratingInsert
-
-
-
-
Constructor Detail
-
AbstractSelectingDelegate
protected AbstractSelectingDelegate(PostInsertIdentityPersister persister)
-
-
Method Detail
-
performInsert
public final Serializable performInsert(String insertSQL, SharedSessionContractImplementor session, Binder binder)
Description copied from interface:InsertGeneratedIdentifierDelegatePerform the indicated insert SQL statement and determine the identifier value generated.- Specified by:
performInsertin interfaceInsertGeneratedIdentifierDelegate- Parameters:
insertSQL- The INSERT statement stringsession- The session in which we are operatingbinder- The param binder- Returns:
- The generated identifier value.
-
getSelectSQL
protected abstract String getSelectSQL()
Get the SQL statement to be used to retrieve generated key values.- Returns:
- The SQL command string
-
bindParameters
protected void bindParameters(SharedSessionContractImplementor session, PreparedStatement ps, Object entity) throws SQLException
Bind any required parameter values into the SQL commandgetSelectSQL().- Parameters:
session- The sessionps- The preparedSQLcommandentity- The entity being saved.- Throws:
SQLException
-
getResult
protected abstract Serializable getResult(SharedSessionContractImplementor session, ResultSet rs, Object entity) throws SQLException
Extract the generated key value from the given result set.- Parameters:
session- The sessionrs- The result set containing the generated primay key values.entity- The entity being saved.- Returns:
- The generated identifier
- Throws:
SQLException
-
-