Package org.hibernate.id.uuid
Class StandardRandomStrategy
- java.lang.Object
-
- org.hibernate.id.uuid.StandardRandomStrategy
-
- All Implemented Interfaces:
Serializable
,UuidValueGenerator
,UUIDGenerationStrategy
public class StandardRandomStrategy extends Object implements UUIDGenerationStrategy, UuidValueGenerator
Implements a "random" UUID generation strategy as defined by theUUID.randomUUID()
method.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StandardRandomStrategy
INSTANCE
-
Constructor Summary
Constructors Constructor Description StandardRandomStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UUID
generateUuid(SharedSessionContractImplementor session)
Generate the UUID valueUUID
generateUUID(SharedSessionContractImplementor session)
Delegates toUUID.randomUUID()
int
getGeneratedVersion()
A variant 4 (random) strategy
-
-
-
Field Detail
-
INSTANCE
public static final StandardRandomStrategy INSTANCE
-
-
Method Detail
-
getGeneratedVersion
public int getGeneratedVersion()
A variant 4 (random) strategy- Specified by:
getGeneratedVersion
in interfaceUUIDGenerationStrategy
- Returns:
- The supported generation version
-
generateUUID
public UUID generateUUID(SharedSessionContractImplementor session)
Delegates toUUID.randomUUID()
- Specified by:
generateUUID
in interfaceUUIDGenerationStrategy
- Parameters:
session
- The session asking for the generation- Returns:
- The generated UUID.
-
generateUuid
public UUID generateUuid(SharedSessionContractImplementor session)
Description copied from interface:UuidValueGenerator
Generate the UUID value- Specified by:
generateUuid
in interfaceUuidValueGenerator
-
-