Package org.hibernate.id.insert
Class AbstractSelectingDelegate
- java.lang.Object
-
- org.hibernate.id.insert.AbstractSelectingDelegate
-
- All Implemented Interfaces:
InsertGeneratedIdentifierDelegate
- Direct Known Subclasses:
BasicSelectingDelegate,UniqueKeySelectingDelegate
public abstract class AbstractSelectingDelegate extends Object implements InsertGeneratedIdentifierDelegate
AbstractInsertGeneratedIdentifierDelegateimplementation where the underlying strategy requires a subsequentselectafter theinsertto 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(Object entity, PreparedStatement ps, SharedSessionContractImplementor session)protected ObjectextractGeneratedValue(ResultSet resultSet, SharedSessionContractImplementor session)Extract the generated key value from the given result set after execution ofgetSelectSQL().protected abstract StringgetSelectSQL()Get the SQL statement to be used to retrieve generated key values.ObjectperformInsert(String insertSQL, SharedSessionContractImplementor session, Binder binder)Execute the giveninsertstatement and return the generated key value.ObjectperformInsert(PreparedStatementDetails insertStatementDetails, JdbcValueBindings jdbcValueBindings, Object entity, SharedSessionContractImplementor session)Perform theinsertand extract the database-generated primary key value.PreparedStatementprepareStatement(String insertSql, SharedSessionContractImplementor session)-
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
createTableInsertBuilder, prepareIdentifierGeneratingInsert, prepareIdentifierGeneratingInsert
-
-
-
-
Constructor Detail
-
AbstractSelectingDelegate
protected AbstractSelectingDelegate(PostInsertIdentityPersister persister)
-
-
Method Detail
-
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(Object entity, PreparedStatement ps, SharedSessionContractImplementor session) throws SQLException
- Throws:
SQLException
-
extractGeneratedValue
protected Object extractGeneratedValue(ResultSet resultSet, SharedSessionContractImplementor session) throws SQLException
Extract the generated key value from the given result set after execution ofgetSelectSQL().- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String insertSql, SharedSessionContractImplementor session)
- Specified by:
prepareStatementin interfaceInsertGeneratedIdentifierDelegate
-
performInsert
public Object performInsert(PreparedStatementDetails insertStatementDetails, JdbcValueBindings jdbcValueBindings, Object entity, SharedSessionContractImplementor session)
Description copied from interface:InsertGeneratedIdentifierDelegatePerform theinsertand extract the database-generated primary key value.
-
performInsert
public final Object performInsert(String insertSQL, SharedSessionContractImplementor session, Binder binder)
Description copied from interface:InsertGeneratedIdentifierDelegateExecute the giveninsertstatement and return the generated key value.- Specified by:
performInsertin interfaceInsertGeneratedIdentifierDelegate- Parameters:
insertSQL- Theinsertstatement stringsession- The session in which we are operatingbinder- The parameter binder- Returns:
- The generated identifier value
-
-