Package org.hibernate.dialect.identity
Class IdentityColumnSupportImpl
java.lang.Object
org.hibernate.dialect.identity.IdentityColumnSupportImpl
- All Implemented Interfaces:
IdentityColumnSupport
- Direct Known Subclasses:
AbstractTransactSQLIdentityColumnSupport
,CockroachDBIdentityColumnSupport
,DB2IdentityColumnSupport
,H2IdentityColumnSupport
,HANAIdentityColumnSupport
,HSQLIdentityColumnSupport
,MySQLIdentityColumnSupport
,Oracle12cIdentityColumnSupport
,PostgreSQLIdentityColumnSupport
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendIdentitySelectToInsert
(String insertString) Provided weIdentityColumnSupport.supportsInsertSelectIdentity()
, then attach the "select identity" clause to the insert statement.buildGetGeneratedKeysDelegate
(EntityPersister persister) The delegate for dealing withIDENTITY
columns 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 tableboolean
Whether this dialect have an Identity clause added to the data type or a completely separate identity data typeboolean
Does this dialect support identity column key generation?boolean
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, hasIdentityInsertKeyword
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
IdentityColumnSupportImpl
public IdentityColumnSupportImpl()
-
-
Method Details
-
supportsIdentityColumns
public boolean supportsIdentityColumns()Description copied from interface:IdentityColumnSupport
Does this dialect support identity column key generation?- Specified by:
supportsIdentityColumns
in interfaceIdentityColumnSupport
- Returns:
- True if IDENTITY columns are supported; false otherwise.
-
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
- Returns:
- True if the dialect supports selecting the just generated IDENTITY in the insert statement.
-
hasDataTypeInIdentityColumn
public boolean hasDataTypeInIdentityColumn()Description copied from interface:IdentityColumnSupport
Whether this dialect have an Identity clause added to the data type or a completely separate identity data type- Specified by:
hasDataTypeInIdentityColumn
in interfaceIdentityColumnSupport
- Returns:
- boolean
-
appendIdentitySelectToInsert
Description copied from interface:IdentityColumnSupport
Provided 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:
appendIdentitySelectToInsert
in interfaceIdentityColumnSupport
- Parameters:
insertString
- The insert command- Returns:
- The insert command with any necessary identity select clause attached.
-
getIdentitySelectString
public String getIdentitySelectString(String table, 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
- 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
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
- Parameters:
type
- TheTypes
type code.- Returns:
- The appropriate DDL fragment.
- Throws:
MappingException
- If IDENTITY generation is not supported.
-
getIdentityInsertString
Description copied from interface:IdentityColumnSupport
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.- Specified by:
getIdentityInsertString
in interfaceIdentityColumnSupport
- Returns:
- The appropriate keyword.
-
buildGetGeneratedKeysDelegate
Description copied from interface:IdentityColumnSupport
The delegate for dealing withIDENTITY
columns usingStatement.getGeneratedKeys()
.- Specified by:
buildGetGeneratedKeysDelegate
in interfaceIdentityColumnSupport
- Parameters:
persister
- The persister- Returns:
- the dialect-specific
GetGeneratedKeysDelegate
-