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
,SybaseAnywhereIdentityColumnSupport
public class AbstractTransactSQLIdentityColumnSupport extends IdentityColumnSupportImpl
-
-
Constructor Summary
Constructors Constructor Description AbstractTransactSQLIdentityColumnSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
appendIdentitySelectToInsert(java.lang.String insertSQL)
Provided weIdentityColumnSupport.supportsInsertSelectIdentity()
, then attach the "select identity" clause to the insert statement.java.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
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
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.-
Methods inherited from class org.hibernate.dialect.identity.IdentityColumnSupportImpl
buildGetGeneratedKeysDelegate, getIdentityInsertString, hasDataTypeInIdentityColumn
-
-
-
-
Method Detail
-
supportsIdentityColumns
public boolean supportsIdentityColumns()
Description copied from interface:IdentityColumnSupport
Does this dialect support identity column key generation?- Specified by:
supportsIdentityColumns
in interfaceIdentityColumnSupport
- Overrides:
supportsIdentityColumns
in classIdentityColumnSupportImpl
- Returns:
- True if IDENTITY columns are supported; false otherwise.
-
getIdentityColumnString
public java.lang.String getIdentityColumnString(int type) throws MappingException
Description copied from interface:IdentityColumnSupport
The syntax used during DDL to define a column as being an IDENTITY of a particular type.- Specified by:
getIdentityColumnString
in interfaceIdentityColumnSupport
- Overrides:
getIdentityColumnString
in classIdentityColumnSupportImpl
- Parameters:
type
- TheTypes
type code.- Returns:
- The appropriate DDL fragment.
- Throws:
MappingException
- If IDENTITY generation is not supported.
-
getIdentitySelectString
public java.lang.String getIdentitySelectString(java.lang.String table, java.lang.String column, int type) throws MappingException
Description copied from interface:IdentityColumnSupport
Get the select command to use to retrieve the last generated IDENTITY value for a particular table- Specified by:
getIdentitySelectString
in interfaceIdentityColumnSupport
- Overrides:
getIdentitySelectString
in classIdentityColumnSupportImpl
- 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.
-
supportsInsertSelectIdentity
public boolean supportsInsertSelectIdentity()
Description copied from interface:IdentityColumnSupport
Does the dialect support some form of inserting and selecting the generated IDENTITY value all in the same statement.- Specified by:
supportsInsertSelectIdentity
in interfaceIdentityColumnSupport
- Overrides:
supportsInsertSelectIdentity
in classIdentityColumnSupportImpl
- Returns:
- True if the dialect supports selecting the just generated IDENTITY in the insert statement.
-
appendIdentitySelectToInsert
public java.lang.String appendIdentitySelectToInsert(java.lang.String insertSQL)
Description copied from interface:IdentityColumnSupport
Provided 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:
appendIdentitySelectToInsert
in interfaceIdentityColumnSupport
- Overrides:
appendIdentitySelectToInsert
in classIdentityColumnSupportImpl
- Parameters:
insertSQL
- The insert command- Returns:
- The insert command with any necessary identity select clause attached.
-
-