org.hibernate.engine
Class CollectionEntry

java.lang.Object
  extended byorg.hibernate.engine.CollectionEntry
All Implemented Interfaces:
CollectionSnapshot, Serializable

public final class CollectionEntry
extends Object
implements CollectionSnapshot, Serializable

We need an entry to tell us all about the current state of a collection with respect to its persistent state

Author:
Gavin King
See Also:
Serialized Form

Constructor Summary
CollectionEntry()
           
 
Method Summary
 Serializable getCurrentKey()
          This is only available late during the flush cycle
 CollectionPersister getCurrentPersister()
           
 boolean getDirty()
           
 Serializable getKey()
           
 Serializable getLoadedKey()
           
 CollectionPersister getLoadedPersister()
          This is only available late during the flush cycle
 Collection getOrphans(String entityName, PersistentCollection coll)
          Get the collection orphans (entities which were removed from the collection)
 String getRole()
           
 Serializable getSnapshot()
           
 void initSnapshot(PersistentCollection collection, CollectionPersister persister)
           
 boolean isDirty()
           
 boolean isDorecreate()
           
 boolean isDoremove()
           
 boolean isDoupdate()
           
 boolean isIgnore()
           
 boolean isInitialized()
           
 boolean isInitializedAndDirty()
           
 boolean isNew()
           
 boolean isProcessed()
           
 boolean isReached()
           
 boolean postFlush(PersistentCollection collection)
          Called after a successful flush, returning true if the collection has been dereferenced, and the entry can be removed.
 void postInitialize(PersistentCollection collection)
           
 void preFlush(PersistentCollection collection)
           
 void setCurrentKey(Serializable currentKey)
           
 void setCurrentPersister(CollectionPersister currentPersister)
           
 void setDirty()
           
 void setDorecreate(boolean dorecreate)
           
 void setDoremove(boolean doremove)
           
 void setDoupdate(boolean doupdate)
           
 void setProcessed(boolean processed)
           
 void setReached(boolean reached)
           
 void setRole(String role)
           
 boolean snapshotIsEmpty()
           
 String toString()
           
 boolean wasDereferenced()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CollectionEntry

public CollectionEntry()
Method Detail

preFlush

public void preFlush(PersistentCollection collection)
              throws HibernateException
Throws:
HibernateException

postInitialize

public void postInitialize(PersistentCollection collection)
                    throws HibernateException
Throws:
HibernateException

postFlush

public boolean postFlush(PersistentCollection collection)
                  throws HibernateException
Called after a successful flush, returning true if the collection has been dereferenced, and the entry can be removed.

Throws:
HibernateException

initSnapshot

public void initSnapshot(PersistentCollection collection,
                         CollectionPersister persister)
                  throws HibernateException
Throws:
HibernateException

getDirty

public boolean getDirty()
Specified by:
getDirty in interface CollectionSnapshot

getKey

public Serializable getKey()
Specified by:
getKey in interface CollectionSnapshot

getRole

public String getRole()
Specified by:
getRole in interface CollectionSnapshot

getSnapshot

public Serializable getSnapshot()
Specified by:
getSnapshot in interface CollectionSnapshot

snapshotIsEmpty

public boolean snapshotIsEmpty()

setDirty

public void setDirty()
Specified by:
setDirty in interface CollectionSnapshot

isNew

public boolean isNew()

wasDereferenced

public boolean wasDereferenced()
Specified by:
wasDereferenced in interface CollectionSnapshot

isDirty

public boolean isDirty()

isReached

public boolean isReached()

setReached

public void setReached(boolean reached)

isProcessed

public boolean isProcessed()

setProcessed

public void setProcessed(boolean processed)

isDoupdate

public boolean isDoupdate()

setDoupdate

public void setDoupdate(boolean doupdate)

isDoremove

public boolean isDoremove()

setDoremove

public void setDoremove(boolean doremove)

isDorecreate

public boolean isDorecreate()

setDorecreate

public void setDorecreate(boolean dorecreate)

isIgnore

public boolean isIgnore()

isInitialized

public boolean isInitialized()

getCurrentPersister

public CollectionPersister getCurrentPersister()

setCurrentPersister

public void setCurrentPersister(CollectionPersister currentPersister)

getCurrentKey

public Serializable getCurrentKey()
This is only available late during the flush cycle


setCurrentKey

public void setCurrentKey(Serializable currentKey)

getLoadedPersister

public CollectionPersister getLoadedPersister()
This is only available late during the flush cycle


getLoadedKey

public Serializable getLoadedKey()

setRole

public void setRole(String role)

toString

public String toString()

isInitializedAndDirty

public boolean isInitializedAndDirty()

getOrphans

public Collection getOrphans(String entityName,
                             PersistentCollection coll)
                      throws HibernateException
Get the collection orphans (entities which were removed from the collection)

Throws:
HibernateException