Top Description Methods
org.hibernate.dialect.identity

public Interface IdentityColumnSupport

Known Direct Implementers
org.hibernate.dialect.identity.IdentityColumnSupportImpl
Imports
org.hibernate.MappingException, org.hibernate.dialect.Dialect, org.hibernate.id.PostInsertIdentityPersister

Represents a support for the Dialect identity key generation
Author
Andrea Boriero
Since
5.1

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The insert command with any necessary identity select clause attached.
appendIdentitySelectToInsert
(String
The insert command
insertString
)

Provided we supportsInsertSelectIdentity, then attach the "select identity" clause to the insert statement.

public default String

Returns:

The insert command with any necessary identity select clause attached.
appendIdentitySelectToInsert
(String
The name of the identity column
identityColumnName
,
String
The insert command
insertString
)

Provided we supportsInsertSelectIdentity, then attach the "select identity" clause to the insert statement.

public GetGeneratedKeysDelegate

Returns:

the dialect specific GetGeneratedKeys delegate
buildGetGeneratedKeysDelegate
(PostInsertIdentityPersister
The persister
persister
,
Dialect
The dialect against which to generate the delegate
dialect
)

The Delegate for dealing with IDENTITY columns using JDBC3 getGeneratedKeys

public String

Returns:

The appropriate DDL fragment.
getIdentityColumnString
(int
The java.sql.Types type code.
type
)

The syntax used during DDL to define a column as being an IDENTITY of a particular type.

public String

Returns:

The appropriate keyword.
getIdentityInsertString
()

The keyword used to insert a generated value into an identity column (or null).

public String

Returns:

The appropriate select command
getIdentitySelectString
(String
The table into which the insert was done
table
,
String
The PK column.
column
,
int
The java.sql.Types type code.
type
)

Get the select command to use to retrieve the last generated IDENTITY value for a particular table

public boolean

Returns:

boolean
hasDataTypeInIdentityColumn
()

Whether this dialect have an Identity clause added to the data type or a completely separate identity data type

public boolean

Returns:

True if IDENTITY columns are supported; false otherwise.
supportsIdentityColumns
()

Does this dialect support identity column key generation?

public boolean

Returns:

True if the dialect supports selecting the just generated IDENTITY in the insert statement.
supportsInsertSelectIdentity
()

Does the dialect support some form of inserting and selecting the generated IDENTITY value all in the same statement.

Method Detail

appendIdentitySelectToInsertback to summary
public String appendIdentitySelectToInsert(String insertString)

Provided we supportsInsertSelectIdentity, then attach the "select identity" clause to the insert statement.

Note, if supportsInsertSelectIdentity == false then the insert-string should be returned without modification.

Parameters
insertString:String

The insert command

Returns:String

The insert command with any necessary identity select clause attached.

appendIdentitySelectToInsertback to summary
public default String appendIdentitySelectToInsert(String identityColumnName, String insertString)

Provided we supportsInsertSelectIdentity, then attach the "select identity" clause to the insert statement.

Note, if supportsInsertSelectIdentity == false then the insert-string should be returned without modification.

Parameters
identityColumnName:String

The name of the identity column

insertString:String

The insert command

Returns:String

The insert command with any necessary identity select clause attached.

buildGetGeneratedKeysDelegateback to summary
public GetGeneratedKeysDelegate buildGetGeneratedKeysDelegate(PostInsertIdentityPersister persister, Dialect dialect)

The Delegate for dealing with IDENTITY columns using JDBC3 getGeneratedKeys

Parameters
persister:PostInsertIdentityPersister

The persister

dialect:Dialect

The dialect against which to generate the delegate

Returns:GetGeneratedKeysDelegate

the dialect specific GetGeneratedKeys delegate

getIdentityColumnStringback to summary
public 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:int

The java.sql.Types type code.

Returns:String

The appropriate DDL fragment.

Exceptions
MappingException:
If IDENTITY generation is not supported.
getIdentityInsertStringback to summary
public 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:String

The appropriate keyword.

getIdentitySelectStringback to summary
public String getIdentitySelectString(String table, 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:String

The table into which the insert was done

column:String

The PK column.

type:int

The java.sql.Types type code.

Returns:String

The appropriate select command

Exceptions
MappingException:
If IDENTITY generation is not supported.
hasDataTypeInIdentityColumnback to summary
public boolean hasDataTypeInIdentityColumn()

Whether this dialect have an Identity clause added to the data type or a completely separate identity data type

Returns:boolean

boolean

supportsIdentityColumnsback to summary
public boolean supportsIdentityColumns()

Does this dialect support identity column key generation?

Returns:boolean

True if IDENTITY columns are supported; false otherwise.

supportsInsertSelectIdentityback to summary
public boolean supportsInsertSelectIdentity()

Does the dialect support some form of inserting and selecting the generated IDENTITY value all in the same statement.

Returns:boolean

True if the dialect supports selecting the just generated IDENTITY in the insert statement.