FileDocCategorySizeDatePackage
DelayedPostInsertIdentifier.javaAPI DocHibernate 3.2.51396Wed Mar 22 07:58:00 GMT 2006org.hibernate.action

DelayedPostInsertIdentifier

public class DelayedPostInsertIdentifier extends Object implements Serializable
Acts as a stand-in for an entity identifier which is supposed to be generated on insert (like an IDENTITY column) where the insert needed to be delayed because we were outside a transaction when the persist occurred (save currently still performs the insert).

The stand-in is only used within the {@link org.hibernate.engine.PersistenceContext} in order to distinguish one instance from another; it is never injected into the entity instance or returned to the client...

author
Steve Ebersole

Fields Summary
private static long
SEQUENCE
private final long
sequence
Constructors Summary
public DelayedPostInsertIdentifier()


	  
		synchronized( DelayedPostInsertIdentifier.class ) {
			if ( SEQUENCE == Long.MAX_VALUE ) {
				SEQUENCE = 0;
			}
			this.sequence = SEQUENCE++;
		}
	
Methods Summary
public booleanequals(java.lang.Object o)

		if ( this == o ) {
			return true;
		}
		if ( o == null || getClass() != o.getClass() ) {
			return false;
		}
		final DelayedPostInsertIdentifier that = ( DelayedPostInsertIdentifier ) o;
		return sequence == that.sequence;
	
public inthashCode()

		return ( int ) ( sequence ^ ( sequence >>> 32 ) );
	
public java.lang.StringtoString()

		return "<delayed:" + sequence + ">";