Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.hibernate.collection.AbstractPersistentCollection
public abstract class AbstractPersistentCollection
extends java.lang.Object
implements Serializable, PersistentCollection
PersistentCollection
Nested Class Summary | |
protected static interface |
Field Summary | |
protected static Object |
Constructor Summary | |
| |
Method Summary | |
boolean | |
void |
|
void |
|
void | |
void |
|
abstract boolean |
|
boolean |
|
void |
|
protected int | |
Object |
|
Serializable |
|
protected static Collection |
|
abstract Collection |
|
Object |
|
Collection |
|
String |
|
SessionImplementor |
|
protected Serializable |
|
Serializable | |
Object |
|
boolean |
|
protected void |
|
protected boolean |
|
boolean |
|
boolean |
|
protected boolean |
|
protected boolean |
|
boolean | |
boolean | |
boolean |
|
protected void |
|
void |
|
void |
|
protected void |
|
Iterator |
|
protected void |
|
protected Object |
|
protected Boolean |
|
protected Boolean |
|
protected boolean |
|
boolean |
|
protected void |
|
protected void | |
void |
|
void |
|
boolean |
|
boolean |
|
protected void |
|
public AbstractPersistentCollection()
Not called by Hibernate, but used by non-JDK serialization, eg. SOAP libraries.
public boolean afterInitialize()
- Specified by:
- afterInitialize in interface PersistentCollection
public void afterRowInsert(CollectionPersister persister, Object entry, int i) throws HibernateException
Called after inserting a row, to fetch the natively generated id
- Specified by:
- afterRowInsert in interface PersistentCollection
public void beginRead()
Called just before reading any rows from the JDBC result set
- Specified by:
- beginRead in interface PersistentCollection
public abstract boolean empty()
Is the initialized collection empty?
- Specified by:
- empty in interface PersistentCollection
public boolean endRead()
Called after reading all rows from the JDBC result set
- Specified by:
- endRead in interface PersistentCollection
public final void forceInitialization() throws HibernateException
To be called internally by the session, forcing immediate initialization.
- Specified by:
- forceInitialization in interface PersistentCollection
protected int getCachedSize()
public Object getIdentifier(Object entry, int i)
- Specified by:
- getIdentifier in interface PersistentCollection
protected static Collection getOrphans(Collection oldElements, Collection currentElements, String entityName, SessionImplementor session) throws HibernateException
Given a collection of entity instances that used to belong to the collection, and a collection of instances that currently belong, return a collection of orphans
public abstract Collection getOrphans(Serializable snapshot, String entityName) throws HibernateException
get all "orphaned" elements
- Specified by:
- getOrphans in interface PersistentCollection
public final Collection getQueuedOrphans(String entityName)
Iterate the "queued" additions
- Specified by:
- getQueuedOrphans in interface PersistentCollection
protected final Serializable getSnapshot()
Get the current snapshot from the session
public final Serializable getStoredSnapshot()
- Specified by:
- getStoredSnapshot in interface PersistentCollection
public Object getValue()
return the user-visible collection (or array) instance
- Specified by:
- getValue in interface PersistentCollection
public final boolean hasQueuedOperations()
Does this instance have any "queued" additions?
- Specified by:
- hasQueuedOperations in interface PersistentCollection
protected final void initialize(boolean writing)
Initialize the collection, if possible, wrapping any exceptions in a runtime exception
- Parameters:
writing
- currently obsolete
protected boolean isClearQueueEnabled()
Is this collection in a state that would allow us to "queue" clear? This is a special case, because of orphan delete.
public boolean isDirectlyAccessible()
Could the application possibly have a direct reference to the underlying collection implementation?
- Specified by:
- isDirectlyAccessible in interface PersistentCollection
protected boolean isOperationQueueEnabled()
Is this collection in a state that would allow us to "queue" operations?
protected boolean isPutQueueEnabled()
Is this collection in a state that would allow us to "queue" puts? This is a special case, because of orphan delete.
public boolean isRowUpdatePossible()
- Specified by:
- isRowUpdatePossible in interface PersistentCollection
public final boolean isUnreferenced()
- Specified by:
- isUnreferenced in interface PersistentCollection
public boolean needsRecreate(CollectionPersister persister)
Do we need to completely recreate this collection when it changes?
- Specified by:
- needsRecreate in interface PersistentCollection
protected final void performQueuedOperations()
After reading all existing elements from the database, add the queued elements to the underlying collection.
public void postAction()
After flushing, clear any "queued" additions, since the database state is now synchronized with the memory state.
- Specified by:
- postAction in interface PersistentCollection
public void preInsert(CollectionPersister persister) throws HibernateException
Called before inserting rows, to ensure that any surrogate keys are fully generated
- Specified by:
- preInsert in interface PersistentCollection
protected final void queueOperation(Object element)
Queue an addition
public final Iterator queuedAdditionIterator()
Iterate the "queued" additions
- Specified by:
- queuedAdditionIterator in interface PersistentCollection
protected final void read()
Called by any read-only method of the collection interface
protected Object readElementByIndex(Object index)
protected Boolean readElementExistence(Object element)
protected Boolean readIndexExistence(Object index)
protected boolean readSize()
Called by the size() method
public final boolean setCurrentSession(SessionImplementor session) throws HibernateException
Associate the collection with the given session.
- Specified by:
- setCurrentSession in interface PersistentCollection
- Returns:
- false if the collection was already associated with the session
- Throws:
HibernateException
- if the collection was already associated with another open session
protected final void setDirectlyAccessible(boolean directlyAccessible)
protected final void setInitialized()
public void setSnapshot(Serializable key, String role, Serializable snapshot)
After flushing, re-init snapshot state.
- Specified by:
- setSnapshot in interface PersistentCollection
public final boolean unsetSession(SessionImplementor currentSession)
Disassociate this collection from the given session.
- Specified by:
- unsetSession in interface PersistentCollection
- Returns:
- true if this was currently associated with the given session
public final boolean wasInitialized()
Is this instance initialized?
- Specified by:
- wasInitialized in interface PersistentCollection
protected final void write()
Called by any writer method of the collection interface