Package org.hibernate.id.uuid
Class StandardRandomStrategy
- java.lang.Object
-
- org.hibernate.id.uuid.StandardRandomStrategy
-
- All Implemented Interfaces:
java.io.Serializable,UUIDGenerationStrategy
public class StandardRandomStrategy extends java.lang.Object implements UUIDGenerationStrategy
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 java.util.UUIDgenerateUUID(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 java.util.UUID generateUUID(SharedSessionContractImplementor session)
Delegates toUUID.randomUUID()- Specified by:
generateUUIDin interfaceUUIDGenerationStrategy- Parameters:
session- The session asking for the generation- Returns:
- The generated UUID.
-
-