Class IdentityColumnSupportBase
java.lang.Object
org.hibernate.dialect.identity.spi.IdentityColumnSupportBase
- All Implemented Interfaces:
IdentityColumnSupport
@SPI({USE,IMPLEMENT})
public class IdentityColumnSupportBase
extends Object
implements IdentityColumnSupport
Provider base for implementing identity-column support.
The inherited behavior represents a database without identity columns.
Override only the operations supported by the database, and supply the
resulting stable instance from
Dialect.getIdentityColumnSupport().
- Since:
- 8.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IdentityColumnSupportReusable support value for a database without identity columns. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct identity support initialized with the conservative defaults. -
Method Summary
Modifier and TypeMethodDescriptionappendIdentitySelectToInsert(String identityColumnName, String insertString) Transform an insert so its execution also returns the generated identity.getIdentityColumnString(int jdbcTypeCode) Render the DDL fragment which declares an identity column.The value keyword written for an identity column, ornullwhen the identity column is omitted from the insert.getIdentitySelectString(String table, String column, int jdbcTypeCode) Render the separate statement used to select the last generated identity.Select the identity-specific retrieval behavior Hibernate should execute.booleanWhether the identity declaration follows an existing SQL data type.booleanWhether identity-column key generation is supported.booleanWhether identity-selection SQL may be combined with or appended to the insert SQL.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IdentityColumnSupport
hasIdentityInsertKeyword
-
Field Details
-
NONE
Reusable support value for a database without identity columns.
-
-
Constructor Details
-
IdentityColumnSupportBase
-
-
Method Details
-
supportsIdentityColumns
public boolean supportsIdentityColumns()Description copied from interface:IdentityColumnSupportWhether identity-column key generation is supported.- Specified by:
supportsIdentityColumnsin interfaceIdentityColumnSupport
-
supportsInsertSelectIdentity
public boolean supportsInsertSelectIdentity()Description copied from interface:IdentityColumnSupportWhether identity-selection SQL may be combined with or appended to the insert SQL.- Specified by:
supportsInsertSelectIdentityin interfaceIdentityColumnSupport
-
hasDataTypeInIdentityColumn
public boolean hasDataTypeInIdentityColumn()Description copied from interface:IdentityColumnSupportWhether the identity declaration follows an existing SQL data type.- Specified by:
hasDataTypeInIdentityColumnin interfaceIdentityColumnSupport
-
appendIdentitySelectToInsert
Description copied from interface:IdentityColumnSupportTransform an insert so its execution also returns the generated identity. Return the input unchanged when no transformation is required.- Specified by:
appendIdentitySelectToInsertin interfaceIdentityColumnSupport
-
getIdentitySelectString
public String getIdentitySelectString(String table, String column, int jdbcTypeCode) throws MappingException Description copied from interface:IdentityColumnSupportRender the separate statement used to select the last generated identity.- Specified by:
getIdentitySelectStringin interfaceIdentityColumnSupport- Throws:
MappingException- when separate identity selection is unsupported
-
getIdentityColumnString
Description copied from interface:IdentityColumnSupportRender the DDL fragment which declares an identity column.- Specified by:
getIdentityColumnStringin interfaceIdentityColumnSupport- Throws:
MappingException- when identity columns are unsupported or the JDBC type is not a valid identity type
-
getIdentityInsertString
Description copied from interface:IdentityColumnSupportThe value keyword written for an identity column, ornullwhen the identity column is omitted from the insert.- Specified by:
getIdentityInsertStringin interfaceIdentityColumnSupport
-
getIdentityValueRetrieval
Description copied from interface:IdentityColumnSupportSelect the identity-specific retrieval behavior Hibernate should execute.- Specified by:
getIdentityValueRetrievalin interfaceIdentityColumnSupport
-