Package org.hibernate.dialect.identity
Class IdentityColumnSupportImpl
- java.lang.Object
-
- org.hibernate.dialect.identity.IdentityColumnSupportImpl
-
- All Implemented Interfaces:
IdentityColumnSupport
- Direct Known Subclasses:
AbstractTransactSQLIdentityColumnSupport,Chache71IdentityColumnSupport,CockroachDB1920IdentityColumnSupport,CUBRIDIdentityColumnSupport,DB2IdentityColumnSupport,H2IdentityColumnSupport,HANAIdentityColumnSupport,HSQLIdentityColumnSupport,InformixIdentityColumnSupport,Ingres9IdentityColumnSupport,JDataStoreIdentityColumnSupport,MimerSQLIdentityColumnSupport,MySQLIdentityColumnSupport,Oracle12cIdentityColumnSupport,PostgreSQL10IdentityColumnSupport,PostgreSQL81IdentityColumnSupport,Teradata14IdentityColumnSupport
public class IdentityColumnSupportImpl extends java.lang.Object implements IdentityColumnSupport
-
-
Constructor Summary
Constructors Constructor Description IdentityColumnSupportImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringappendIdentitySelectToInsert(java.lang.String insertString)Provided weIdentityColumnSupport.supportsInsertSelectIdentity(), then attach the "select identity" clause to the insert statement.GetGeneratedKeysDelegatebuildGetGeneratedKeysDelegate(PostInsertIdentityPersister persister, Dialect dialect)The Delegate for dealing with IDENTITY columns using JDBC3 getGeneratedKeysjava.lang.StringgetIdentityColumnString(int type)The syntax used during DDL to define a column as being an IDENTITY of a particular type.java.lang.StringgetIdentityInsertString()The keyword used to insert a generated value into an identity column (or null).java.lang.StringgetIdentitySelectString(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 tablebooleanhasDataTypeInIdentityColumn()Whether this dialect have an Identity clause added to the data type or a completely separate identity data typebooleansupportsIdentityColumns()Does this dialect support identity column key generation?booleansupportsInsertSelectIdentity()Does the dialect support some form of inserting and selecting the generated IDENTITY value all in the same statement.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.dialect.identity.IdentityColumnSupport
appendIdentitySelectToInsert
-
-
-
-
Method Detail
-
supportsIdentityColumns
public boolean supportsIdentityColumns()
Description copied from interface:IdentityColumnSupportDoes this dialect support identity column key generation?- Specified by:
supportsIdentityColumnsin interfaceIdentityColumnSupport- Returns:
- True if IDENTITY columns are supported; false otherwise.
-
supportsInsertSelectIdentity
public boolean supportsInsertSelectIdentity()
Description copied from interface:IdentityColumnSupportDoes the dialect support some form of inserting and selecting the generated IDENTITY value all in the same statement.- Specified by:
supportsInsertSelectIdentityin interfaceIdentityColumnSupport- Returns:
- True if the dialect supports selecting the just generated IDENTITY in the insert statement.
-
hasDataTypeInIdentityColumn
public boolean hasDataTypeInIdentityColumn()
Description copied from interface:IdentityColumnSupportWhether this dialect have an Identity clause added to the data type or a completely separate identity data type- Specified by:
hasDataTypeInIdentityColumnin interfaceIdentityColumnSupport- Returns:
- boolean
-
appendIdentitySelectToInsert
public java.lang.String appendIdentitySelectToInsert(java.lang.String insertString)
Description copied from interface:IdentityColumnSupportProvided weIdentityColumnSupport.supportsInsertSelectIdentity(), then attach the "select identity" clause to the insert statement. Note, ifIdentityColumnSupport.supportsInsertSelectIdentity()== false then the insert-string should be returned without modification.- Specified by:
appendIdentitySelectToInsertin interfaceIdentityColumnSupport- Parameters:
insertString- The insert command- Returns:
- The insert command with any necessary identity select clause attached.
-
getIdentitySelectString
public java.lang.String getIdentitySelectString(java.lang.String table, java.lang.String column, int type) throws MappingExceptionDescription copied from interface:IdentityColumnSupportGet the select command to use to retrieve the last generated IDENTITY value for a particular table- Specified by:
getIdentitySelectStringin interfaceIdentityColumnSupport- 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
public java.lang.String getIdentityColumnString(int type) throws MappingExceptionDescription copied from interface:IdentityColumnSupportThe syntax used during DDL to define a column as being an IDENTITY of a particular type.- Specified by:
getIdentityColumnStringin interfaceIdentityColumnSupport- Parameters:
type- TheTypestype code.- Returns:
- The appropriate DDL fragment.
- Throws:
MappingException- If IDENTITY generation is not supported.
-
getIdentityInsertString
public java.lang.String getIdentityInsertString()
Description copied from interface:IdentityColumnSupportThe 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.- Specified by:
getIdentityInsertStringin interfaceIdentityColumnSupport- Returns:
- The appropriate keyword.
-
buildGetGeneratedKeysDelegate
public GetGeneratedKeysDelegate buildGetGeneratedKeysDelegate(PostInsertIdentityPersister persister, Dialect dialect)
Description copied from interface:IdentityColumnSupportThe Delegate for dealing with IDENTITY columns using JDBC3 getGeneratedKeys- Specified by:
buildGetGeneratedKeysDelegatein interfaceIdentityColumnSupport- Parameters:
persister- The persisterdialect- The dialect against which to generate the delegate- Returns:
- the dialect specific GetGeneratedKeys delegate
-
-