Top Description Interfaces Classes Enums
[default module]

Package org.hibernate.id


This package and its subpackages, especially org.hibernate.id.enhanced, contain the built-in id generators, all of which implement either org.hibernate.id.IdentifierGenerator or org.hibernate.id.PostInsertIdentifierGenerator.

The most useful id generators in modern Hibernate are:

API Note

The remaining id generators are kept around for backward compatibility and as an implementation detail of the hbm.xml mapping format.

See Also
org.hibernate.generator

Interface Summary

Modifier and TypeInterface and Description
public interface
BulkInsertionCapableIdentifierGenerator

Specialized contract for IdentifierGenerator implementations capable of being used in conjunction with HQL insert statements.

public interface
Configurable

An IdentifierGenerator that supports "configuration".

public interface
IdentifierGenerator

A classic extension point from the very earliest days of Hibernate, this interface is no longer the only way to generate identifiers.

public interface
IdentifierGeneratorAggregator

Identifies generators which potentially aggregate other PersistentIdentifierGenerator generators.

public interface
IntegralDataTypeHolder

Defines a common API for dealing with data of integral data type.

public interface
OptimizableGenerator

Commonality between sequence-based and table-based generators

public interface
PersistentIdentifierGenerator

An IdentifierGenerator that requires creation of database objects.

public interface
PostInsertIdentifierGenerator

The counterpart to IdentifierGenerator for values generated by the database.

public interface
PostInsertIdentityPersister

A persister that may have an identity assigned by execution of a SQL INSERT.

public interface
ResultSetIdentifierConsumer

Deprecated for removal since 6.2. this interface is unnecessary and no longer used
An optional contract for org.hibernate.type.Type or org.hibernate.usertype.UserType implementations to handle generated id values any way they see fit as opposed to being limited to the discrete set of numeric types handled by IdentifierGeneratorHelper
public interface
UUIDGenerationStrategy

Deprecated since 6.0. see UUIDGenerator
A strategy for generating a variant 2 UUID value.

Class Summary

Modifier and TypeClass and Description
public abstract class
AbstractPostInsertGenerator

Deprecated for removal since 6.2. Subclasses should now directly inherit PostInsertIdentifierGenerator and BulkInsertionCapableIdentifierGenerator, or even better, simply implement org.hibernate.generator.OnExecutionGenerator directly.
Basic implementation of the PostInsertIdentifierGenerator contract.
public abstract class
AbstractUUIDGenerator

Deprecated since 6. since UUIDHexGenerator is deprecated
The base class for identifier generators that use a UUID algorithm.
public class
Assigned

An IdentifierGenerator that returns the current identifier assigned to an instance.

public class
CompositeNestedGeneratedValueGenerator

For composite identifiers, defines a number of "nested" generations that need to happen to "fill" the identifier property(s).

public class
public class
ForeignGenerator

Deprecated for removal since 6. This remains around as an implementation detail of hbm.xml mappings.
The legacy id generator named foreign.
public class
GUIDGenerator

Deprecated since 6.0. use org.hibernate.id.uuid.UuidGenerator
The legacy id generator named guid.
public class
IdentifierGenerationException

Thrown by an IdentifierGenerator implementation class when ID generation fails.

public class
IdentifierGeneratorHelper

Factory and helper methods for IdentifierGenerator framework.

public class
IdentityGenerator

An OnExecutionGenerator that handles IDENTITY/"autoincrement" columns on those databases which support them.

public class
IncrementGenerator

An IdentifierGenerator that returns a long, constructed by counting from the maximum primary key value obtained by querying the table or tables at startup.

public class
SelectGenerator

A generator that selects the just-inserted row to determine the column value assigned by the database.

public class
UUIDGenerator

An IdentifierGenerator which generates UUID values using a pluggable generation strategy.
public class
UUIDHexGenerator

Deprecated since 6. This remains around as an implementation detail of hbm.xml mappings.
The legacy id generator named uuid / uuid.hex.

Enum Summary

Modifier and TypeEnum and Description
public enum
EntityIdentifierNature

Describes the possible natures of an entity-defined identifier.

public enum
SequenceMismatchStrategy

Describes the strategy for handling the mismatch between a database sequence configuration and the one defined by the entity mapping.