Package org.hibernate.id.insert
Class AbstractSelectingDelegate
- java.lang.Object
-
- org.hibernate.generator.values.AbstractGeneratedValuesMutationDelegate
-
- org.hibernate.id.insert.AbstractSelectingDelegate
-
- All Implemented Interfaces:
GeneratedValuesMutationDelegate,InsertGeneratedIdentifierDelegate
- Direct Known Subclasses:
BasicSelectingDelegate,UniqueKeySelectingDelegate
public abstract class AbstractSelectingDelegate extends AbstractGeneratedValuesMutationDelegate implements InsertGeneratedIdentifierDelegate
AbstractGeneratedValuesMutationDelegateimplementation where the underlying strategy requires a subsequentselectafter theinsertto determine the generated identifier.
-
-
Field Summary
-
Fields inherited from class org.hibernate.generator.values.AbstractGeneratedValuesMutationDelegate
jdbcValuesMappingProducer, persister
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSelectingDelegate(PostInsertIdentityPersister persister)Deprecated, for removal: This API element is subject to removal in a future version.protectedAbstractSelectingDelegate(EntityPersister persister, EventType timing, boolean supportsArbitraryValues, boolean supportsRowId)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidbindParameters(Object entity, PreparedStatement ps, SharedSessionContractImplementor session)protected ObjectextractGeneratedValues(ResultSet resultSet, SharedSessionContractImplementor session)Deprecated, for removal: This API element is subject to removal in a future version.No substitute.protected abstract StringgetSelectSQL()Get the SQL statement to be used to retrieve generated key values.GeneratedValuesperformInsertReturning(String sql, SharedSessionContractImplementor session, Binder binder)Execute the giveninsertstatement and return the generated key value.GeneratedValuesperformMutation(PreparedStatementDetails statementDetails, JdbcValueBindings jdbcValueBindings, Object entity, SharedSessionContractImplementor session)Perform themutationand extract the database-generated values.PreparedStatementprepareStatement(String insertSql, SharedSessionContractImplementor session)Create aPreparedStatementfrom the providedsqlbased on the delegate needs.-
Methods inherited from class org.hibernate.generator.values.AbstractGeneratedValuesMutationDelegate
dialect, getGeneratedValuesMappingProducer, getTiming, supportsArbitraryValues, supportsRowId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.generator.values.GeneratedValuesMutationDelegate
createTableMutationBuilder, getGeneratedValuesMappingProducer, getTiming, supportsArbitraryValues, supportsRowId
-
Methods inherited from interface org.hibernate.id.insert.InsertGeneratedIdentifierDelegate
createTableInsertBuilder, performInsert, performInsert, prepareIdentifierGeneratingInsert
-
-
-
-
Constructor Detail
-
AbstractSelectingDelegate
@Deprecated(forRemoval=true, since="6.5") protected AbstractSelectingDelegate(PostInsertIdentityPersister persister)
Deprecated, for removal: This API element is subject to removal in a future version.
-
AbstractSelectingDelegate
protected AbstractSelectingDelegate(EntityPersister persister, EventType timing, boolean supportsArbitraryValues, boolean supportsRowId)
-
-
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
-
extractGeneratedValues
@Deprecated(forRemoval=true, since="6.5") protected Object extractGeneratedValues(ResultSet resultSet, SharedSessionContractImplementor session) throws SQLException
Deprecated, for removal: This API element is subject to removal in a future version.No substitute.- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String insertSql, SharedSessionContractImplementor session)
Description copied from interface:GeneratedValuesMutationDelegateCreate aPreparedStatementfrom the providedsqlbased on the delegate needs.- Specified by:
prepareStatementin interfaceGeneratedValuesMutationDelegate- Specified by:
prepareStatementin interfaceInsertGeneratedIdentifierDelegate
-
performMutation
public GeneratedValues performMutation(PreparedStatementDetails statementDetails, JdbcValueBindings jdbcValueBindings, Object entity, SharedSessionContractImplementor session)
Description copied from interface:GeneratedValuesMutationDelegatePerform themutationand extract the database-generated values.
-
performInsertReturning
public final GeneratedValues performInsertReturning(String sql, SharedSessionContractImplementor session, Binder binder)
Description copied from interface:InsertGeneratedIdentifierDelegateExecute the giveninsertstatement and return the generated key value.- Specified by:
performInsertReturningin interfaceInsertGeneratedIdentifierDelegate- Parameters:
sql- Theinsertstatement stringsession- The session in which we are operatingbinder- The parameter binder- Returns:
- The generated identifier value
-
-