org.hibernate.id

Class IdentityGenerator

Implemented Interfaces:
IdentifierGenerator, PostInsertIdentifierGenerator

public class IdentityGenerator
extends AbstractPostInsertGenerator

A generator for use with ANSI-SQL IDENTITY columns used as the primary key. The IdentityGenerator for autoincrement/identity key generation.

Indicates to the Session that identity (ie. identity/autoincrement column) key generation should be used.
Author:
Christoph Sturm

Nested Class Summary

static class
IdentityGenerator.BasicDelegate
Delegate for dealing with IDENTITY columns where the dialect requires an additional command execution to retrieve the generated IDENTITY value
static class
IdentityGenerator.GetGeneratedKeysDelegate
Delegate for dealing with IDENTITY columns using JDBC3 getGeneratedKeys
static class
IdentityGenerator.InsertSelectDelegate
Delegate for dealing with IDENTITY columns where the dialect supports returning the generated IDENTITY value directly from the insert statement.

Fields inherited from interface org.hibernate.id.IdentifierGenerator

ENTITY_NAME

Method Summary

InsertGeneratedIdentifierDelegate
getInsertGeneratedIdentifierDelegate(PostInsertIdentityPersister persister, Dialect dialect, boolean isGetGeneratedKeysEnabled)

Methods inherited from class org.hibernate.id.AbstractPostInsertGenerator

generate

Method Details

getInsertGeneratedIdentifierDelegate

public InsertGeneratedIdentifierDelegate getInsertGeneratedIdentifierDelegate(PostInsertIdentityPersister persister,
                                                                              Dialect dialect,
                                                                              boolean isGetGeneratedKeysEnabled)
            throws HibernateException
Specified by:
getInsertGeneratedIdentifierDelegate in interface PostInsertIdentifierGenerator