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 StandardRandomStrategyINSTANCE
-
Constructor Summary
Constructors Constructor Description StandardRandomStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UUIDgenerateUuid(SharedSessionContractImplementor session)Generate the UUID valueUUIDgenerateUUID(SharedSessionContractImplementor session)Delegates toUUID.randomUUID()intgetGeneratedVersion()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:
getGeneratedVersionin interfaceUUIDGenerationStrategy- Returns:
- The supported generation version
-
generateUUID
public UUID generateUUID(SharedSessionContractImplementor session)
Delegates toUUID.randomUUID()- Specified by:
generateUUIDin interfaceUUIDGenerationStrategy- Parameters:
session- The session asking for the generation- Returns:
- The generated UUID.
-
generateUuid
public UUID generateUuid(SharedSessionContractImplementor session)
Description copied from interface:UuidValueGeneratorGenerate the UUID value- Specified by:
generateUuidin interfaceUuidValueGenerator
-
-