Package org.hibernate.dialect.identity
Class AbstractTransactSQLIdentityColumnSupport
java.lang.Object
org.hibernate.dialect.identity.IdentityColumnSupportImpl
org.hibernate.dialect.identity.AbstractTransactSQLIdentityColumnSupport
- All Implemented Interfaces:
IdentityColumnSupport
- Direct Known Subclasses:
SQLServerIdentityColumnSupport,SybaseJconnIdentityColumnSupport
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendIdentitySelectToInsert(String insertSQL) Provided weIdentityColumnSupport.supportsInsertSelectIdentity(), then attach the "select identity" clause to the insert statement.getIdentityColumnString(int type) The syntax used during DDL to define a column as being an IDENTITY of a particular type.getIdentitySelectString(String table, String column, int type) Get the select command to use to retrieve the last generated IDENTITY value for a particular tablebooleanDoes 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.Methods inherited from class org.hibernate.dialect.identity.IdentityColumnSupportImpl
buildGetGeneratedKeysDelegate, getIdentityInsertString, hasDataTypeInIdentityColumnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.dialect.identity.IdentityColumnSupport
appendIdentitySelectToInsert, hasIdentityInsertKeyword
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
AbstractTransactSQLIdentityColumnSupport
public AbstractTransactSQLIdentityColumnSupport()
-
-
Method Details
-
supportsIdentityColumns
public boolean supportsIdentityColumns()Description copied from interface:IdentityColumnSupportDoes this dialect support identity column key generation?- Specified by:
supportsIdentityColumnsin interfaceIdentityColumnSupport- Overrides:
supportsIdentityColumnsin classIdentityColumnSupportImpl- Returns:
- True if IDENTITY columns are supported; false otherwise.
-
getIdentityColumnString
Description copied from interface:IdentityColumnSupportThe syntax used during DDL to define a column as being an IDENTITY of a particular type.- Specified by:
getIdentityColumnStringin interfaceIdentityColumnSupport- Overrides:
getIdentityColumnStringin classIdentityColumnSupportImpl- Parameters:
type- TheTypestype code.- Returns:
- The appropriate DDL fragment.
- Throws:
MappingException- If IDENTITY generation is not supported.
-
getIdentitySelectString
public String getIdentitySelectString(String table, String column, int type) throws MappingException Description copied from interface:IdentityColumnSupportGet the select command to use to retrieve the last generated IDENTITY value for a particular table- Specified by:
getIdentitySelectStringin interfaceIdentityColumnSupport- Overrides:
getIdentitySelectStringin classIdentityColumnSupportImpl- 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.
-
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- Overrides:
supportsInsertSelectIdentityin classIdentityColumnSupportImpl- Returns:
- True if the dialect supports selecting the just generated IDENTITY in the insert statement.
-
appendIdentitySelectToInsert
Description copied from interface:IdentityColumnSupportProvided weIdentityColumnSupport.supportsInsertSelectIdentity(), then attach the "select identity" clause to the insert statement.Note, if
IdentityColumnSupport.supportsInsertSelectIdentity()== false then the insert-string should be returned without modification.- Specified by:
appendIdentitySelectToInsertin interfaceIdentityColumnSupport- Overrides:
appendIdentitySelectToInsertin classIdentityColumnSupportImpl- Parameters:
insertSQL- The insert command- Returns:
- The insert command with any necessary identity select clause attached.
-