Package org.hibernate.id.insert
Interface InsertGeneratedIdentifierDelegate
-
- All Superinterfaces:
GeneratedValuesMutationDelegate
- All Known Implementing Classes:
AbstractReturningDelegate
,AbstractSelectingDelegate
,BasicSelectingDelegate
,GetGeneratedKeysDelegate
,InsertReturningDelegate
,Oracle12cGetGeneratedKeysDelegate
,SybaseJConnGetGeneratedKeysDelegate
,UniqueKeySelectingDelegate
@Deprecated(forRemoval=true, since="6.5") public interface InsertGeneratedIdentifierDelegate extends GeneratedValuesMutationDelegate
Deprecated, for removal: This API element is subject to removal in a future version.UseGeneratedValuesMutationDelegate
instead.Each implementation defines a strategy for retrieving a primary key generated by the database from the database after execution of aninsert
statement. The generated primary key is usually anIDENTITY
column, but in principle it might be something else, for example, a value generated by a trigger.An implementation controls:
- building the SQL
insert
statement, and - retrieving the generated identifier value using JDBC.
The implementation should be written to handle any instance of
OnExecutionGenerator
.- See Also:
OnExecutionGenerator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default TableInsertBuilder
createTableInsertBuilder(BasicEntityIdentifierMapping identifierMapping, Expectation expectation, SessionFactoryImplementor sessionFactory)
Deprecated, for removal: This API element is subject to removal in a future version.Create aTableInsertBuilder
with any specific identity handling already built in.default Object
performInsert(String insertSQL, SharedSessionContractImplementor session, Binder binder)
Deprecated, for removal: This API element is subject to removal in a future version.Execute the giveninsert
statement and return the generated key value.default Object
performInsert(PreparedStatementDetails insertStatementDetails, JdbcValueBindings valueBindings, Object entity, SharedSessionContractImplementor session)
Deprecated, for removal: This API element is subject to removal in a future version.Perform theinsert
and extract the database-generated primary key value.GeneratedValues
performInsertReturning(String insertSQL, SharedSessionContractImplementor session, Binder binder)
Deprecated, for removal: This API element is subject to removal in a future version.Execute the giveninsert
statement and return the generated key value.default String
prepareIdentifierGeneratingInsert(String insertSQL)
Deprecated, for removal: This API element is subject to removal in a future version.Append SQL specific to this delegate's mode of handling generated primary key values to the giveninsert
statement.PreparedStatement
prepareStatement(String insertSql, SharedSessionContractImplementor session)
Deprecated, for removal: This API element is subject to removal in a future version.Create aPreparedStatement
from the providedsql
based on the delegate needs.-
Methods inherited from interface org.hibernate.generator.values.GeneratedValuesMutationDelegate
createTableMutationBuilder, getGeneratedValuesMappingProducer, getTiming, performMutation, supportsArbitraryValues, supportsRowId
-
-
-
-
Method Detail
-
createTableInsertBuilder
default TableInsertBuilder createTableInsertBuilder(BasicEntityIdentifierMapping identifierMapping, Expectation expectation, SessionFactoryImplementor sessionFactory)
Deprecated, for removal: This API element is subject to removal in a future version.Create aTableInsertBuilder
with any specific identity handling already built in.
-
prepareStatement
PreparedStatement prepareStatement(String insertSql, SharedSessionContractImplementor session)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:GeneratedValuesMutationDelegate
Create aPreparedStatement
from the providedsql
based on the delegate needs.- Specified by:
prepareStatement
in interfaceGeneratedValuesMutationDelegate
-
performInsert
default Object performInsert(PreparedStatementDetails insertStatementDetails, JdbcValueBindings valueBindings, Object entity, SharedSessionContractImplementor session)
Deprecated, for removal: This API element is subject to removal in a future version.Perform theinsert
and extract the database-generated primary key value.
-
prepareIdentifierGeneratingInsert
default String prepareIdentifierGeneratingInsert(String insertSQL)
Deprecated, for removal: This API element is subject to removal in a future version.Append SQL specific to this delegate's mode of handling generated primary key values to the giveninsert
statement.- Returns:
- The processed
insert
statement string
-
performInsert
default Object performInsert(String insertSQL, SharedSessionContractImplementor session, Binder binder)
Deprecated, for removal: This API element is subject to removal in a future version.Execute the giveninsert
statement and return the generated key value.- Parameters:
insertSQL
- Theinsert
statement stringsession
- The session in which we are operatingbinder
- The parameter binder- Returns:
- The generated identifier value
-
performInsertReturning
GeneratedValues performInsertReturning(String insertSQL, SharedSessionContractImplementor session, Binder binder)
Deprecated, for removal: This API element is subject to removal in a future version.Execute the giveninsert
statement and return the generated key value.- Parameters:
insertSQL
- Theinsert
statement stringsession
- The session in which we are operatingbinder
- The parameter binder- Returns:
- The generated identifier value
-
-