Top Description Inners Methods
org.hibernate.annotations

public @Interface UuidGenerator

extends Annotation
Annotations
@IdGeneratorType:UuidGenerator
@ValueGenerationType
generatedBy:UuidGenerator
@Retention:RUNTIME
@Target:FIELD, METHOD
Imports
java.lang.annotation.Retention, .RetentionPolicy, .Target, java.util.UUID

Specifies that an entity identifier is generated as an IETF RFC 4122 UUID.

The type of the identifier attribute may be UUID or String.

Author
Steve Ebersole
Since
6.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
UuidGenerator.Style

Represents a kind of UUID, that is, what RFC 4122 calls a "version".

Method Summary

Modifier and TypeMethod and Description
public UuidGenerator.Style
style()

Specifies which style of UUID generation should be used.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

styleback to summary
public UuidGenerator.Style style()

Specifies which style of UUID generation should be used.

org.hibernate.annotations back to summary

public final Enum UuidGenerator.Style

extends Enum<UuidGenerator.Style>
Class Inheritance

Represents a kind of UUID, that is, what RFC 4122 calls a "version".

Field Summary

Modifier and TypeField and Description
public static final UuidGenerator.Style
AUTO

Defaults to RANDOM.

public static final UuidGenerator.Style
RANDOM

Use UUID#randomUUID() to generate UUIDs, producing a value compatible with RFC 4122 version 4.

public static final UuidGenerator.Style
TIME

Use a time-based generation strategy consistent with RFC 4122 version 1, but with IP address instead of MAC address.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static UuidGenerator.Style
public static UuidGenerator.Style[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

AUTOback to summary
public static final UuidGenerator.Style AUTO

Defaults to RANDOM.

RANDOMback to summary
public static final UuidGenerator.Style RANDOM

Use UUID#randomUUID() to generate UUIDs, producing a value compatible with RFC 4122 version 4.

TIMEback to summary
public static final UuidGenerator.Style TIME

Use a time-based generation strategy consistent with RFC 4122 version 1, but with IP address instead of MAC address.

Implementation Note

Can be a bottleneck, since synchronization is used when incrementing an internal counter as part of the algorithm.

Constructor Detail

Styleback to summary
private Style()

Method Detail

valueOfback to summary
public static UuidGenerator.Style valueOf(String name)
valuesback to summary
public static UuidGenerator.Style[] values()