Top Description Inners Fields Constructors Methods
org.hibernate.id.uuid

public Class UuidGenerator

extends Object
implements BeforeExecutionGenerator
Class Inheritance
All Implemented Interfaces
org.hibernate.generator.BeforeExecutionGenerator, org.hibernate.generator.Generator, java.io.Serializable
Imports
java.lang.reflect.Member, java.util.EnumSet, .UUID, org.hibernate.HibernateException, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.generator.EventType, .EventTypeSets, .GeneratorCreationContext, .BeforeExecutionGenerator, org.hibernate.id.factory.spi.CustomIdGeneratorCreationContext, org.hibernate.type.descriptor.java.UUIDJavaType, .UUIDJavaType.ValueTransformer

Generates UUIDs.
See Also
org.hibernate.annotations.UuidGenerator

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface

Field Summary

Modifier and TypeField and Description
private final UuidGenerator.ValueGenerator
private final UUIDJavaType.ValueTransformer

Constructor Summary

AccessConstructor and Description
private
public
public

Method Summary

Modifier and TypeMethod and Description
public Object
generate(SharedSessionContractImplementor
The session from which the request originates.
session
,
Object
The instance of the object owning the attribute for which we are generating a value.
owner
,
Object
The current value assigned to the property, or null
currentValue
,
EventType
The type of event that has triggered generation of a new value
eventType
)

Implements org.hibernate.generator.BeforeExecutionGenerator.generate.

Generate a value.
public EnumSet<EventType>
getEventTypes()

Implements org.hibernate.generator.Generator.getEventTypes.

The event types for which this generator should be called to produce a new value.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

generatorback to summary
private final UuidGenerator.ValueGenerator generator
valueTransformerback to summary
private final UUIDJavaType.ValueTransformer valueTransformer

Constructor Detail

UuidGeneratorback to summary
private UuidGenerator(UuidGenerator config, Member idMember)
UuidGeneratorback to summary
public UuidGenerator(UuidGenerator config, Member idMember, CustomIdGeneratorCreationContext creationContext)
UuidGeneratorback to summary
public UuidGenerator(UuidGenerator config, Member member, GeneratorCreationContext creationContext)

Method Detail

generateback to summary
public Object generate(SharedSessionContractImplementor session, Object owner, Object currentValue, EventType eventType)

Implements org.hibernate.generator.BeforeExecutionGenerator.generate.

Doc from org.hibernate.generator.BeforeExecutionGenerator.generate.

Generate a value.

Parameters
session:SharedSessionContractImplementor

The session from which the request originates.

owner:Object

The instance of the object owning the attribute for which we are generating a value.

currentValue:Object

The current value assigned to the property, or null

eventType:EventType

The type of event that has triggered generation of a new value

Returns:Object

The generated value

Annotations
@Override
getEventTypesback to summary
public EnumSet<EventType> getEventTypes()

Implements org.hibernate.generator.Generator.getEventTypes.

Doc from org.hibernate.generator.Generator.getEventTypes.

The event types for which this generator should be called to produce a new value.

Identifier generators must return EventTypeSets#INSERT_ONLY.

Returns:EnumSet<EventType>

EventTypeSets#INSERT_ONLY

Annotations
@Override
org.hibernate.id.uuid back to summary

pack-priv Interface UuidGenerator.ValueGenerator

Known Direct Implementers
org.hibernate.id.uuid.CustomVersionOneStrategy, org.hibernate.id.uuid.StandardRandomStrategy

Method Summary

Modifier and TypeMethod and Description
public UUID

Method Detail

generateUuidback to summary
public UUID generateUuid(SharedSessionContractImplementor session)