org.hibernate.test.annotations.id.sequences
Class UUIDGenerator

java.lang.Object
  extended by org.hibernate.test.annotations.id.sequences.UUIDGenerator
All Implemented Interfaces:
IdentifierGenerator

public class UUIDGenerator
extends Object
implements IdentifierGenerator

Unlike Hibernate's UUID generator. This avoids meaningless synchronization and has less than a chance of an asteroid hitting you on the head even after trillions of rows are inserted. I know this to be true because it says so in Wikipedia(haha). http://en.wikipedia.org/wiki/UUID#Random_UUID_probability_of_duplicates


Field Summary
 
Fields inherited from interface org.hibernate.id.IdentifierGenerator
ENTITY_NAME
 
Constructor Summary
UUIDGenerator()
           
 
Method Summary
 Serializable generate(SessionImplementor arg0, Object arg1)
          Generate a new identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UUIDGenerator

public UUIDGenerator()
Method Detail

generate

public Serializable generate(SessionImplementor arg0,
                             Object arg1)
                      throws HibernateException
Description copied from interface: IdentifierGenerator
Generate a new identifier.

Specified by:
generate in interface IdentifierGenerator
arg1 - the entity or toplevel collection for which the id is being generated
Returns:
a new identifier
Throws:
HibernateException


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