public final class CollectionEntry extends Object implements Serializable
We need an entry to tell us all about the current state of a collection with respect to its persistent state
Constructor and Description |
---|
CollectionEntry(CollectionPersister persister,
PersistentCollection collection)
For newly wrapped collections, or dereferenced collection wrappers
|
CollectionEntry(CollectionPersister loadedPersister,
Serializable loadedKey)
For uninitialized detached collections
|
CollectionEntry(PersistentCollection collection,
CollectionPersister loadedPersister,
Serializable loadedKey,
boolean ignore)
For collections just loaded from the database
|
CollectionEntry(PersistentCollection collection,
SessionFactoryImplementor factory)
For initialized detached collections
|
Modifier and Type | Method and Description |
---|---|
void |
afterAction(PersistentCollection collection)
Called after execution of an action
|
static CollectionEntry |
deserialize(ObjectInputStream ois,
SessionImplementor session)
Custom deserialization routine used during deserialization of a
Session/PersistenceContext for increased performance.
|
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 |
resetStoredSnapshot(PersistentCollection collection,
Serializable storedSnapshot)
Reset the stored snapshot for both the persistent collection and this collection entry.
|
void |
serialize(ObjectOutputStream oos)
Custom serialization routine used during serialization of a
Session/PersistenceContext for increased performance.
|
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() |
public CollectionEntry(CollectionPersister persister, PersistentCollection collection)
For newly wrapped collections, or dereferenced collection wrappers
public CollectionEntry(PersistentCollection collection, CollectionPersister loadedPersister, Serializable loadedKey, boolean ignore)
For collections just loaded from the database
public CollectionEntry(CollectionPersister loadedPersister, Serializable loadedKey)
For uninitialized detached collections
public CollectionEntry(PersistentCollection collection, SessionFactoryImplementor factory) throws MappingException
For initialized detached collections
MappingException
public void preFlush(PersistentCollection collection) throws HibernateException
HibernateException
public void postInitialize(PersistentCollection collection) throws HibernateException
HibernateException
public void postFlush(PersistentCollection collection) throws HibernateException
Called after a successful flush
HibernateException
public void afterAction(PersistentCollection collection)
Called after execution of an action
public Serializable getKey()
public String getRole()
public Serializable getSnapshot()
public void resetStoredSnapshot(PersistentCollection collection, Serializable storedSnapshot)
Reset the stored snapshot for both the persistent collection and this collection entry. Used during the merge of detached collections.
collection
- the persistentcollection to be updatedstoredSnapshot
- the new stored snapshotpublic boolean wasDereferenced()
public boolean isReached()
public void setReached(boolean reached)
public boolean isProcessed()
public void setProcessed(boolean processed)
public boolean isDoupdate()
public void setDoupdate(boolean doupdate)
public boolean isDoremove()
public void setDoremove(boolean doremove)
public boolean isDorecreate()
public void setDorecreate(boolean dorecreate)
public boolean isIgnore()
public CollectionPersister getCurrentPersister()
public void setCurrentPersister(CollectionPersister currentPersister)
public Serializable getCurrentKey()
This is only available late during the flush cycle
public void setCurrentKey(Serializable currentKey)
public CollectionPersister getLoadedPersister()
This is only available late during the flush cycle
public Serializable getLoadedKey()
public void setRole(String role)
public Collection getOrphans(String entityName, PersistentCollection collection) throws HibernateException
Get the collection orphans (entities which were removed from the collection)
HibernateException
public boolean isSnapshotEmpty(PersistentCollection collection)
public void serialize(ObjectOutputStream oos) throws IOException
Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance.
oos
- The stream to which we should write the serial data.IOException
public static CollectionEntry deserialize(ObjectInputStream ois, SessionImplementor session) throws IOException, ClassNotFoundException
Custom deserialization routine used during deserialization of a Session/PersistenceContext for increased performance.
ois
- The stream from which to read the entry.session
- The session being deserialized.IOException
ClassNotFoundException
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.