Interface InsertGeneratedIdentifierDelegate

All Superinterfaces:
GeneratedValuesMutationDelegate
All Known Implementing Classes:
AbstractReturningDelegate, AbstractSelectingDelegate, BasicSelectingDelegate, GetGeneratedKeysDelegate, InsertReturningDelegate, SybaseJConnGetGeneratedKeysDelegate, UniqueKeySelectingDelegate

@Deprecated(since="6.5", forRemoval=true) public interface InsertGeneratedIdentifierDelegate extends GeneratedValuesMutationDelegate
Deprecated, for removal: This API element is subject to removal in a future version.
Each implementation defines a strategy for retrieving a primary key generated by the database from the database after execution of an insert statement. The generated primary key is usually an IDENTITY 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:
  • Method Details

    • 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 a PreparedStatement from the provided sql based on the delegate needs.
      Specified by:
      prepareStatement in interface GeneratedValuesMutationDelegate
    • 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 given insert statement.
      Returns:
      The processed insert statement string
    • 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 given insert statement and return the generated key value.
      Parameters:
      insertSQL - The insert statement string
      session - The session in which we are operating
      binder - The parameter binder
      Returns:
      The generated identifier value