Interface IdentityColumnSupport

All Known Implementing Classes:
IdentityColumnSupportBase

@SPI({USE,IMPLEMENT,SUPPLY}) public interface IdentityColumnSupport

Defines the identity-column DDL, insert syntax, and identity-specific value retrieval semantics of a Dialect.

Providers may implement this contract directly or extend IdentityColumnSupportBase, and must supply one stable non-null instance from Dialect.getIdentityColumnSupport(). Implementations describe SQL and the semantic retrieval choice only; they must not construct Hibernate mutation delegates or depend on entity persisters.

Since:
8.0
See Also:
  • Method Details

    • supportsIdentityColumns

      boolean supportsIdentityColumns()
      Whether identity-column key generation is supported.
    • supportsInsertSelectIdentity

      boolean supportsInsertSelectIdentity()
      Whether identity-selection SQL may be combined with or appended to the insert SQL.
    • hasDataTypeInIdentityColumn

      boolean hasDataTypeInIdentityColumn()
      Whether the identity declaration follows an existing SQL data type.
    • appendIdentitySelectToInsert

      String appendIdentitySelectToInsert(String identityColumnName, String insertString)
      Transform an insert so its execution also returns the generated identity. Return the input unchanged when no transformation is required.
    • getIdentitySelectString

      String getIdentitySelectString(String table, String column, int jdbcTypeCode) throws MappingException
      Render the separate statement used to select the last generated identity.
      Throws:
      MappingException - when separate identity selection is unsupported
    • getIdentityColumnString

      String getIdentityColumnString(int jdbcTypeCode) throws MappingException
      Render the DDL fragment which declares an identity column.
      Throws:
      MappingException - when identity columns are unsupported or the JDBC type is not a valid identity type
    • getIdentityInsertString

      String getIdentityInsertString()
      The value keyword written for an identity column, or null when the identity column is omitted from the insert.
    • hasIdentityInsertKeyword

      default boolean hasIdentityInsertKeyword()
      Whether getIdentityInsertString() supplies a value keyword.
    • getIdentityValueRetrieval

      IdentityValueRetrieval getIdentityValueRetrieval()
      Select the identity-specific retrieval behavior Hibernate should execute.