org.hibernate.id.uuid
Class StandardRandomStrategy

java.lang.Object
  extended by org.hibernate.id.uuid.StandardRandomStrategy
All Implemented Interfaces:
Serializable, UUIDGenerationStrategy

public class StandardRandomStrategy
extends Object
implements UUIDGenerationStrategy

Implements a "random" UUID generation strategy as defined by the UUID.randomUUID() method.

See Also:
Serialized Form

Field Summary
static StandardRandomStrategy INSTANCE
           
 
Constructor Summary
StandardRandomStrategy()
           
 
Method Summary
 UUID generateUUID(SessionImplementor session)
          Delegates to UUID.randomUUID()
 int getGeneratedVersion()
          A variant 4 (random) strategy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final StandardRandomStrategy INSTANCE
Constructor Detail

StandardRandomStrategy

public StandardRandomStrategy()
Method Detail

getGeneratedVersion

public int getGeneratedVersion()
A variant 4 (random) strategy

Specified by:
getGeneratedVersion in interface UUIDGenerationStrategy
Returns:
The supported generation version

generateUUID

public UUID generateUUID(SessionImplementor session)
Delegates to UUID.randomUUID()

Specified by:
generateUUID in interface UUIDGenerationStrategy
Parameters:
session - The session asking for the generation
Returns:
The generated UUID.


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.