Top Description Fields Constructors Methods
org.hibernate.engine.spi

public final Class CollectionEntry

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .Serializable, java.util.Collection, org.hibernate.AssertionFailure, .HibernateException, .MappingException, org.hibernate.collection.internal.AbstractPersistentCollection, org.hibernate.collection.spi.PersistentCollection, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.persister.collection.CollectionPersister, org.hibernate.pretty.MessageHelper

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

Field Summary

Modifier and TypeField and Description
private transient Serializable
private transient CollectionPersister
private transient boolean
private transient boolean
private transient boolean
private boolean
private transient boolean
private Serializable
private transient CollectionPersister
private static final CoreMessageLogger
private transient boolean
private transient boolean
private String
private Serializable

Constructor Summary

AccessConstructor and Description
public
CollectionEntry(CollectionPersister persister, PersistentCollection collection)

For newly wrapped collections, or dereferenced collection wrappers

public
CollectionEntry(final PersistentCollection collection, final CollectionPersister loadedPersister, final Serializable loadedKey, final 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)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
For initialized detached collections
private
CollectionEntry(String role, Serializable snapshot, Serializable loadedKey, SessionFactoryImplementor factory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Used from custom serialization.

Method Summary

Modifier and TypeMethod and Description
public void
afterAction(PersistentCollection collection)

Called after execution of an action

pack-priv void
afterDeserialize(SessionFactoryImplementor factory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
public static CollectionEntry

Returns:

The deserialized CollectionEntry
deserialize
(ObjectInputStream
The stream from which to read the entry.
ois
,
SessionImplementor
The session being deserialized.
session
)

Deprecated as a consequence of SessionImplementor being deprecated.
Custom deserialization routine used during deserialization of a Session/PersistenceContext for increased performance.
private void
dirty(PersistentCollection collection)

Determine if the collection is "really" dirty, by checking dirtiness of the collection elements, if necessary

public Serializable
getCurrentKey()

This is only available late during the flush cycle

public CollectionPersister
public Serializable
public Serializable
public CollectionPersister
getLoadedPersister()

This is only available late during the flush cycle

public Collection<E>
getOrphans(String entityName, PersistentCollection collection)

Get the collection orphans (entities which were removed from the collection)

public String
public Serializable
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public void
postFlush(PersistentCollection collection)

Called after a successful flush

public void
public void
public void
resetStoredSnapshot(PersistentCollection
the persistentcollection to be updated
collection
,
Serializable
the new stored snapshot
storedSnapshot
)

Reset the stored snapshot for both the persistent collection and this collection entry.

public void
serialize(ObjectOutputStream
The stream to which we should write the serial data.
oos
)

Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance.

public void
public void
public void
setDorecreate(boolean dorecreate)

public void
setDoremove(boolean doremove)

public void
setDoupdate(boolean doupdate)

private void
public void
setProcessed(boolean processed)

public void
setReached(boolean reached)

public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

currentKeyback to summary
private transient Serializable currentKey
currentPersisterback to summary
private transient CollectionPersister currentPersister
dorecreateback to summary
private transient boolean dorecreate
doremoveback to summary
private transient boolean doremove
doupdateback to summary
private transient boolean doupdate
fromMergeback to summary
private boolean fromMerge
ignoreback to summary
private transient boolean ignore
loadedKeyback to summary
private Serializable loadedKey
loadedPersisterback to summary
private transient CollectionPersister loadedPersister
LOGback to summary
private static final CoreMessageLogger LOG
processedback to summary
private transient boolean processed
reachedback to summary
private transient boolean reached
roleback to summary
private String role
snapshotback to summary
private Serializable snapshot

Constructor Detail

CollectionEntryback to summary
public CollectionEntry(CollectionPersister persister, PersistentCollection collection)

For newly wrapped collections, or dereferenced collection wrappers

CollectionEntryback to summary
public CollectionEntry(final PersistentCollection collection, final CollectionPersister loadedPersister, final Serializable loadedKey, final boolean ignore)

For collections just loaded from the database

CollectionEntryback to summary
public CollectionEntry(CollectionPersister loadedPersister, Serializable loadedKey)

For uninitialized detached collections

CollectionEntryback to summary
public CollectionEntry(PersistentCollection collection, SessionFactoryImplementor factory) throws MappingException

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

For initialized detached collections

CollectionEntryback to summary
private CollectionEntry(String role, Serializable snapshot, Serializable loadedKey, SessionFactoryImplementor factory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Used from custom serialization.

See Also
serialize, deserialize

Method Detail

afterActionback to summary
public void afterAction(PersistentCollection collection)

Called after execution of an action

afterDeserializeback to summary
pack-priv void afterDeserialize(SessionFactoryImplementor factory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

deserializeback to summary
public static CollectionEntry deserialize(ObjectInputStream ois, SessionImplementor session) throws IOException, ClassNotFoundException

Deprecated

as a consequence of SessionImplementor being deprecated. See corresponding docs for further information.

Custom deserialization routine used during deserialization of a Session/PersistenceContext for increased performance.

Parameters
ois:ObjectInputStream

The stream from which to read the entry.

session:SessionImplementor

The session being deserialized.

Returns:CollectionEntry

The deserialized CollectionEntry

dirtyback to summary
private void dirty(PersistentCollection collection) throws HibernateException

Determine if the collection is "really" dirty, by checking dirtiness of the collection elements, if necessary

getCurrentKeyback to summary
public Serializable getCurrentKey()

This is only available late during the flush cycle

getCurrentPersisterback to summary
public CollectionPersister getCurrentPersister()
getKeyback to summary
public Serializable getKey()
getLoadedKeyback to summary
public Serializable getLoadedKey()
getLoadedPersisterback to summary
public CollectionPersister getLoadedPersister()

This is only available late during the flush cycle

getOrphansback to summary
public Collection<E> getOrphans(String entityName, PersistentCollection collection) throws HibernateException

Get the collection orphans (entities which were removed from the collection)

getRoleback to summary
public String getRole()
getSnapshotback to summary
public Serializable getSnapshot()
isDorecreateback to summary
public boolean isDorecreate()
isDoremoveback to summary
public boolean isDoremove()
isDoupdateback to summary
public boolean isDoupdate()
isIgnoreback to summary
public boolean isIgnore()
isProcessedback to summary
public boolean isProcessed()
isReachedback to summary
public boolean isReached()
isSnapshotEmptyback to summary
public boolean isSnapshotEmpty(PersistentCollection collection)
postFlushback to summary
public void postFlush(PersistentCollection collection) throws HibernateException

Called after a successful flush

postInitializeback to summary
public void postInitialize(PersistentCollection collection) throws HibernateException
preFlushback to summary
public void preFlush(PersistentCollection collection) throws HibernateException
resetStoredSnapshotback to summary
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.

Parameters
collection:PersistentCollection

the persistentcollection to be updated

storedSnapshot:Serializable

the new stored snapshot

serializeback to summary
public void serialize(ObjectOutputStream oos) throws IOException

Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance.

Parameters
oos:ObjectOutputStream

The stream to which we should write the serial data.

setCurrentKeyback to summary
public void setCurrentKey(Serializable currentKey)
setCurrentPersisterback to summary
public void setCurrentPersister(CollectionPersister currentPersister)
setDorecreateback to summary
public void setDorecreate(boolean dorecreate)
setDoremoveback to summary
public void setDoremove(boolean doremove)
setDoupdateback to summary
public void setDoupdate(boolean doupdate)
setLoadedPersisterback to summary
private void setLoadedPersister(CollectionPersister persister)
setProcessedback to summary
public void setProcessed(boolean processed)
setReachedback to summary
public void setReached(boolean reached)
setRoleback to summary
public void setRole(String role)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
wasDereferencedback to summary
public boolean wasDereferenced()