Package org.hibernate.dialect.identity
Interface IdentityColumnSupport
- All Known Implementing Classes:
AbstractTransactSQLIdentityColumnSupport,CockroachDBIdentityColumnSupport,DB2IdentityColumnSupport,DB2zIdentityColumnSupport,H2FinalTableIdentityColumnSupport,H2IdentityColumnSupport,HANAIdentityColumnSupport,HSQLIdentityColumnSupport,IdentityColumnSupportImpl,MariaDBIdentityColumnSupport,MySQLIdentityColumnSupport,Oracle12cIdentityColumnSupport,PostgreSQLIdentityColumnSupport,SQLServerIdentityColumnSupport,SybaseJconnIdentityColumnSupport
public interface IdentityColumnSupport
A set of operations providing support for identity columns
in a certain
SQL dialect.- Since:
- 5.1
-
Method Summary
Modifier and TypeMethodDescriptionappendIdentitySelectToInsert(String insertString) Deprecated, for removal: This API element is subject to removal in a future version.default StringappendIdentitySelectToInsert(String identityColumnName, String insertString) Provided wesupportsInsertSelectIdentity(), then attach the "select identity" clause to the insert statement.buildGetGeneratedKeysDelegate(EntityPersister persister) The delegate for dealing withIDENTITYcolumns usingStatement.getGeneratedKeys().getIdentityColumnString(int type) The syntax used during DDL to define a column as being an IDENTITY of a particular type.The keyword used to insert a generated value into an identity column (or null).getIdentitySelectString(String table, String column, int type) Get the select command to use to retrieve the last generated IDENTITY value for a particular tablebooleanWhether this dialect have an Identity clause added to the data type or a completely separate identity data typedefault booleanIs there a keyword used to insert a generated value into an identity column.booleanDoes this dialect support identity column key generation?booleanDoes the dialect support some form of inserting and selecting the generated IDENTITY value all in the same statement.
-
Method Details
-
supportsIdentityColumns
boolean supportsIdentityColumns()Does this dialect support identity column key generation?- Returns:
- True if IDENTITY columns are supported; false otherwise.
-
supportsInsertSelectIdentity
boolean supportsInsertSelectIdentity()Does the dialect support some form of inserting and selecting the generated IDENTITY value all in the same statement.- Returns:
- True if the dialect supports selecting the just generated IDENTITY in the insert statement.
-
hasDataTypeInIdentityColumn
boolean hasDataTypeInIdentityColumn()Whether this dialect have an Identity clause added to the data type or a completely separate identity data type- Returns:
- boolean
-
appendIdentitySelectToInsert
Deprecated, for removal: This API element is subject to removal in a future version.UseappendIdentitySelectToInsert(String, String)instead.Provided wesupportsInsertSelectIdentity(), then attach the "select identity" clause to the insert statement.Note, if
supportsInsertSelectIdentity()== false then the insert-string should be returned without modification.- Parameters:
insertString- The insert command- Returns:
- The insert command with any necessary identity select clause attached.
-
appendIdentitySelectToInsert
Provided wesupportsInsertSelectIdentity(), then attach the "select identity" clause to the insert statement.Note, if
supportsInsertSelectIdentity()== false then the insert-string should be returned without modification.- Parameters:
identityColumnName- The name of the identity columninsertString- The insert command- Returns:
- The insert command with any necessary identity select clause attached.
-
getIdentitySelectString
Get the select command to use to retrieve the last generated IDENTITY value for a particular table- Parameters:
table- The table into which the insert was donecolumn- The PK column.type- TheTypestype code.- Returns:
- The appropriate select command
- Throws:
MappingException- If IDENTITY generation is not supported.
-
getIdentityColumnString
The syntax used during DDL to define a column as being an IDENTITY of a particular type.- Parameters:
type- TheTypestype code.- Returns:
- The appropriate DDL fragment.
- Throws:
MappingException- If IDENTITY generation is not supported.
-
getIdentityInsertString
String getIdentityInsertString()The keyword used to insert a generated value into an identity column (or null). Need if the dialect does not support inserts that specify no column values.- Returns:
- The appropriate keyword.
-
hasIdentityInsertKeyword
default boolean hasIdentityInsertKeyword()Is there a keyword used to insert a generated value into an identity column.- Returns:
trueif the dialect does not support inserts that specify no column values.
-
buildGetGeneratedKeysDelegate
The delegate for dealing withIDENTITYcolumns usingStatement.getGeneratedKeys().- Parameters:
persister- The persister- Returns:
- the dialect-specific
GetGeneratedKeysDelegate
-
appendIdentitySelectToInsert(String, String)instead.