public class

UUIDGenerator

extends Object
implements Configurable IdentifierGenerator
java.lang.Object
   ↳ org.hibernate.id.UUIDGenerator

Class Overview

An IdentifierGenerator which generates UUID values using a pluggable generation strategy. The values this generator can return include UUID, String and byte[16]

Supports 2 config parameters:

Currently there are 2 standard implementations of UUIDGenerationStrategy:

Summary

Constants
String UUID_GEN_STRATEGY
String UUID_GEN_STRATEGY_CLASS
[Expand]
Inherited Constants
From interface org.hibernate.id.IdentifierGenerator
Public Constructors
UUIDGenerator()
Public Methods
static UUIDGenerator buildSessionFactoryUniqueIdentifierGenerator()
void configure(Type type, Properties params, Dialect d)
Configure this instance, given the value of parameters specified by the user as <param> elements.
Serializable generate(SessionImplementor session, Object object)
Generate a new identifier.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.hibernate.id.Configurable
From interface org.hibernate.id.IdentifierGenerator

Constants

public static final String UUID_GEN_STRATEGY

Constant Value: "uuid_gen_strategy"

public static final String UUID_GEN_STRATEGY_CLASS

Constant Value: "uuid_gen_strategy_class"

Public Constructors

public UUIDGenerator ()

Public Methods

public static UUIDGenerator buildSessionFactoryUniqueIdentifierGenerator ()

public void configure (Type type, Properties params, Dialect d)

Configure this instance, given the value of parameters specified by the user as <param> elements. This method is called just once, following instantiation.

Parameters
params param values, keyed by parameter name

public Serializable generate (SessionImplementor session, Object object)

Generate a new identifier.

Parameters
object the entity or toplevel collection for which the id is being generated
Returns
  • a new identifier