public class UUIDGenerator extends java.lang.Object implements IdentifierGenerator, Configurable
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:UUID_GEN_STRATEGY - names the UUIDGenerationStrategy instance to useUUID_GEN_STRATEGY_CLASS - names the UUIDGenerationStrategy class to useUUIDGenerationStrategy:StandardRandomStrategy (the default, if none specified)CustomVersionOneStrategy| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
UUID_GEN_STRATEGY |
static java.lang.String |
UUID_GEN_STRATEGY_CLASS |
ENTITY_NAME| Constructor and Description |
|---|
UUIDGenerator() |
| Modifier and Type | Method and Description |
|---|---|
static UUIDGenerator |
buildSessionFactoryUniqueIdentifierGenerator() |
void |
configure(Type type,
java.util.Properties params,
Dialect d)
Configure this instance, given the value of parameters
specified by the user as <param> elements.
|
java.io.Serializable |
generate(SessionImplementor session,
java.lang.Object object)
Generate a new identifier.
|
public static final java.lang.String UUID_GEN_STRATEGY
public static final java.lang.String UUID_GEN_STRATEGY_CLASS
public static UUIDGenerator buildSessionFactoryUniqueIdentifierGenerator()
public void configure(Type type, java.util.Properties params, Dialect d) throws MappingException
Configurableconfigure in interface Configurableparams - param values, keyed by parameter nameMappingExceptionpublic java.io.Serializable generate(SessionImplementor session, java.lang.Object object) throws HibernateException
IdentifierGeneratorgenerate in interface IdentifierGeneratorobject - the entity or toplevel collection for which the id is being generatedHibernateExceptionCopyright © 2013. All Rights Reserved.