org.hibernate.engine

Class CollectionEntry

Implemented Interfaces:
Serializable

public final class CollectionEntry
extends java.lang.Object
implements 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

Constructor Summary

CollectionEntry(PersistentCollection collection, CollectionPersister loadedPersister, Serializable loadedKey, boolean ignore)
For collections just loaded from the database
CollectionEntry(CollectionPersister loadedPersister, Serializable loadedKey)
For uninitialized detached collections
CollectionEntry(CollectionPersister persister, PersistentCollection collection)
For newly wrapped collections, or dereferenced collection wrappers

Method Summary

void
afterAction(PersistentCollection collection)
Called after execution of an action
Serializable
getCurrentKey()
This is only available late during the flush cycle
CollectionPersister
getCurrentPersister()
Serializable
getKey()
Serializable
getLoadedKey()
CollectionPersister
getLoadedPersister()
This is only available late during the flush cycle
Collection
getOrphans(String entityName, PersistentCollection collection)
Get the collection orphans (entities which were removed from the collection)
String
getRole()
Serializable
getSnapshot()
boolean
isDorecreate()
boolean
isDoremove()
boolean
isDoupdate()
boolean
isIgnore()
boolean
isProcessed()
boolean
isReached()
boolean
isSnapshotEmpty(PersistentCollection collection)
void
postFlush(PersistentCollection collection)
Called after a successful flush
void
postInitialize(PersistentCollection collection)
void
preFlush(PersistentCollection collection)
void
setCurrentKey(Serializable currentKey)
void
setCurrentPersister(CollectionPersister currentPersister)
void
setDorecreate(boolean dorecreate)
void
setDoremove(boolean doremove)
void
setDoupdate(boolean doupdate)
void
setProcessed(boolean processed)
void
setReached(boolean reached)
void
setRole(String role)
String
toString()
boolean
wasDereferenced()

Constructor Details

CollectionEntry

public CollectionEntry(PersistentCollection collection,
                       CollectionPersister loadedPersister,
                       Serializable loadedKey,
                       boolean ignore)
For collections just loaded from the database

CollectionEntry

public CollectionEntry(CollectionPersister loadedPersister,
                       Serializable loadedKey)
For uninitialized detached collections

CollectionEntry

public CollectionEntry(CollectionPersister persister,
                       PersistentCollection collection)
For newly wrapped collections, or dereferenced collection wrappers

Method Details

afterAction

public void afterAction(PersistentCollection collection)
Called after execution of an action

getCurrentKey

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

getCurrentPersister

public CollectionPersister getCurrentPersister()

getKey

public Serializable getKey()

getLoadedKey

public Serializable getLoadedKey()

getLoadedPersister

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

getOrphans

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

getRole

public String getRole()

getSnapshot

public Serializable getSnapshot()

isDorecreate

public boolean isDorecreate()

isDoremove

public boolean isDoremove()

isDoupdate

public boolean isDoupdate()

isIgnore

public boolean isIgnore()

isProcessed

public boolean isProcessed()

isReached

public boolean isReached()

isSnapshotEmpty

public boolean isSnapshotEmpty(PersistentCollection collection)

postFlush

public void postFlush(PersistentCollection collection)
            throws HibernateException
Called after a successful flush

postInitialize

public void postInitialize(PersistentCollection collection)
            throws HibernateException

preFlush

public void preFlush(PersistentCollection collection)
            throws HibernateException

setCurrentKey

public void setCurrentKey(Serializable currentKey)

setCurrentPersister

public void setCurrentPersister(CollectionPersister currentPersister)

setDorecreate

public void setDorecreate(boolean dorecreate)

setDoremove

public void setDoremove(boolean doremove)

setDoupdate

public void setDoupdate(boolean doupdate)

setProcessed

public void setProcessed(boolean processed)

setReached

public void setReached(boolean reached)

setRole

public void setRole(String role)

toString

public String toString()

wasDereferenced

public boolean wasDereferenced()