Package org.hibernate.dialect.identity
Interface IdentityColumnSupport
-
- All Known Implementing Classes:
AbstractTransactSQLIdentityColumnSupport
,Chache71IdentityColumnSupport
,CockroachDB1920IdentityColumnSupport
,CUBRIDIdentityColumnSupport
,DB2390IdentityColumnSupport
,DB2IdentityColumnSupport
,H2FinalTableIdentityColumnSupport
,H2IdentityColumnSupport
,HANAIdentityColumnSupport
,HSQLIdentityColumnSupport
,IdentityColumnSupportImpl
,InformixIdentityColumnSupport
,Ingres10IdentityColumnSupport
,Ingres9IdentityColumnSupport
,JDataStoreIdentityColumnSupport
,MimerSQLIdentityColumnSupport
,MySQLIdentityColumnSupport
,Oracle12cIdentityColumnSupport
,PostgreSQL10IdentityColumnSupport
,PostgreSQL81IdentityColumnSupport
,SQLServerIdentityColumnSupport
,SybaseAnywhereIdentityColumnSupport
,Teradata14IdentityColumnSupport
public interface IdentityColumnSupport
Represents a support for the Dialect identity key generation- Since:
- 5.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.String
appendIdentitySelectToInsert(java.lang.String insertString)
Provided wesupportsInsertSelectIdentity()
, then attach the "select identity" clause to the insert statement.default java.lang.String
appendIdentitySelectToInsert(java.lang.String identityColumnName, java.lang.String insertString)
Provided wesupportsInsertSelectIdentity()
, then attach the "select identity" clause to the insert statement.GetGeneratedKeysDelegate
buildGetGeneratedKeysDelegate(PostInsertIdentityPersister persister, Dialect dialect)
The Delegate for dealing with IDENTITY columns using JDBC3 getGeneratedKeysjava.lang.String
getIdentityColumnString(int type)
The syntax used during DDL to define a column as being an IDENTITY of a particular type.java.lang.String
getIdentityInsertString()
The keyword used to insert a generated value into an identity column (or null).java.lang.String
getIdentitySelectString(java.lang.String table, java.lang.String column, int type)
Get the select command to use to retrieve the last generated IDENTITY value for a particular tableboolean
hasDataTypeInIdentityColumn()
Whether this dialect have an Identity clause added to the data type or a completely separate identity data typeboolean
supportsIdentityColumns()
Does this dialect support identity column key generation?boolean
supportsInsertSelectIdentity()
Does the dialect support some form of inserting and selecting the generated IDENTITY value all in the same statement.
-
-
-
Method Detail
-
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
java.lang.String appendIdentitySelectToInsert(java.lang.String insertString)
Provided wesupportsInsertSelectIdentity()
, then attach the "select identity" clause to the insert statement. Note, ifsupportsInsertSelectIdentity()
== 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
default java.lang.String appendIdentitySelectToInsert(java.lang.String identityColumnName, java.lang.String insertString)
Provided wesupportsInsertSelectIdentity()
, then attach the "select identity" clause to the insert statement. Note, ifsupportsInsertSelectIdentity()
== 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
java.lang.String getIdentitySelectString(java.lang.String table, java.lang.String column, int type) throws MappingException
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
- TheTypes
type code.- Returns:
- The appropriate select command
- Throws:
MappingException
- If IDENTITY generation is not supported.
-
getIdentityColumnString
java.lang.String getIdentityColumnString(int type) throws MappingException
The syntax used during DDL to define a column as being an IDENTITY of a particular type.- Parameters:
type
- TheTypes
type code.- Returns:
- The appropriate DDL fragment.
- Throws:
MappingException
- If IDENTITY generation is not supported.
-
getIdentityInsertString
java.lang.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.
-
buildGetGeneratedKeysDelegate
GetGeneratedKeysDelegate buildGetGeneratedKeysDelegate(PostInsertIdentityPersister persister, Dialect dialect)
The Delegate for dealing with IDENTITY columns using JDBC3 getGeneratedKeys- Parameters:
persister
- The persisterdialect
- The dialect against which to generate the delegate- Returns:
- the dialect specific GetGeneratedKeys delegate
-
-