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
AbstractGeneratedValuesMutationDelegate
implementation where the underlying strategy requires a subsequentselect
after theinsert
to determine the generated identifier.
-
-
Field Summary
-
Fields inherited from class org.hibernate.generator.values.AbstractGeneratedValuesMutationDelegate
jdbcValuesMappingProducer, persister
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractSelectingDelegate(PostInsertIdentityPersister persister)
Deprecated, for removal: This API element is subject to removal in a future version.protected
AbstractSelectingDelegate(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 void
bindParameters(Object entity, PreparedStatement ps, SharedSessionContractImplementor session)
protected Object
extractGeneratedValues(ResultSet resultSet, SharedSessionContractImplementor session)
Deprecated, for removal: This API element is subject to removal in a future version.No substitute.protected abstract String
getSelectSQL()
Get the SQL statement to be used to retrieve generated key values.GeneratedValues
performInsertReturning(String sql, SharedSessionContractImplementor session, Binder binder)
Execute the giveninsert
statement and return the generated key value.GeneratedValues
performMutation(PreparedStatementDetails statementDetails, JdbcValueBindings jdbcValueBindings, Object entity, SharedSessionContractImplementor session)
Perform themutation
and extract the database-generated values.PreparedStatement
prepareStatement(String insertSql, SharedSessionContractImplementor session)
Create aPreparedStatement
from the providedsql
based 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:GeneratedValuesMutationDelegate
Create aPreparedStatement
from the providedsql
based on the delegate needs.- Specified by:
prepareStatement
in interfaceGeneratedValuesMutationDelegate
- Specified by:
prepareStatement
in interfaceInsertGeneratedIdentifierDelegate
-
performMutation
public GeneratedValues performMutation(PreparedStatementDetails statementDetails, JdbcValueBindings jdbcValueBindings, Object entity, SharedSessionContractImplementor session)
Description copied from interface:GeneratedValuesMutationDelegate
Perform themutation
and extract the database-generated values.
-
performInsertReturning
public final GeneratedValues performInsertReturning(String sql, SharedSessionContractImplementor session, Binder binder)
Description copied from interface:InsertGeneratedIdentifierDelegate
Execute the giveninsert
statement and return the generated key value.- Specified by:
performInsertReturning
in interfaceInsertGeneratedIdentifierDelegate
- Parameters:
sql
- Theinsert
statement stringsession
- The session in which we are operatingbinder
- The parameter binder- Returns:
- The generated identifier value
-
-