Package org.hibernate.id
Class UUIDGenerator
- java.lang.Object
-
- org.hibernate.id.UUIDGenerator
-
- All Implemented Interfaces:
Serializable
,ExportableProducer
,BeforeExecutionGenerator
,Generator
,Configurable
,StandardGenerator
,IdentifierGenerator
@Deprecated(since="6.0") public class UUIDGenerator extends Object implements IdentifierGenerator, StandardGenerator
Deprecated.useUuidGenerator
andUuidGenerator
insteadAnIdentifierGenerator
which generatesUUID
values using a pluggablegeneration strategy
. The values this generator can return includeUUID
,String
and byte[16]Supports 2 config parameters:
UUID_GEN_STRATEGY
- names theUUIDGenerationStrategy
instance to useUUID_GEN_STRATEGY_CLASS
- names theUUIDGenerationStrategy
class to use
Currently, there are 2 standard implementations of
UUIDGenerationStrategy
:StandardRandomStrategy
(the default, if none specified)CustomVersionOneStrategy
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
UUID_GEN_STRATEGY
Deprecated.static String
UUID_GEN_STRATEGY_CLASS
Deprecated.-
Fields inherited from interface org.hibernate.id.IdentifierGenerator
CONTRIBUTOR_NAME, ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME
-
-
Constructor Summary
Constructors Constructor Description UUIDGenerator()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
configure(Type type, Properties parameters, ServiceRegistry serviceRegistry)
Deprecated.Configure this instance, given the value of parameters specified by the user as<param>
elements.Object
generate(SharedSessionContractImplementor session, Object object)
Deprecated.Generate a new identifier.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.generator.BeforeExecutionGenerator
generatedOnExecution
-
Methods inherited from interface org.hibernate.id.Configurable
create, initialize
-
Methods inherited from interface org.hibernate.generator.Generator
allowAssignedIdentifiers, generatedOnExecution, generatesOnInsert, generatesOnUpdate, generatesSometimes
-
Methods inherited from interface org.hibernate.id.IdentifierGenerator
generate, getEventTypes, registerExportables, supportsJdbcBatchInserts
-
-
-
-
Field Detail
-
UUID_GEN_STRATEGY
public static final String UUID_GEN_STRATEGY
Deprecated.- See Also:
- Constant Field Values
-
UUID_GEN_STRATEGY_CLASS
public static final String UUID_GEN_STRATEGY_CLASS
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
configure
public void configure(Type type, Properties parameters, ServiceRegistry serviceRegistry) throws MappingException
Deprecated.Description copied from interface:IdentifierGenerator
Configure this instance, given the value of parameters specified by the user as<param>
elements.This method is called just once, following instantiation, and before
IdentifierGenerator.registerExportables(Database)
.- Specified by:
configure
in interfaceConfigurable
- Specified by:
configure
in interfaceIdentifierGenerator
- Parameters:
type
- The id property type descriptorparameters
- param values, keyed by parameter nameserviceRegistry
- Access to service that may be needed.- Throws:
MappingException
- If configuration fails.
-
generate
public Object generate(SharedSessionContractImplementor session, Object object) throws HibernateException
Deprecated.Description copied from interface:IdentifierGenerator
Generate a new identifier.- Specified by:
generate
in interfaceIdentifierGenerator
- Parameters:
session
- The session from which the request originatesobject
- the entity or collection (idbag) for which the id is being generated- Returns:
- a new identifier
- Throws:
HibernateException
- Indicates trouble generating the identifier
-
-