|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.hibernate.collection.AbstractPersistentCollection
Base class implementing PersistentCollection
PersistentCollection,
Serialized Form| Constructor Summary | |
|
AbstractPersistentCollection()
Not called by Hibernate, but used by non-JDK serialization, eg. |
protected |
AbstractPersistentCollection(SessionImplementor session)
|
| Method Summary | |
void |
afterRowInsert(CollectionPersister persister,
Object entry,
int i)
Called after inserting a row, to fetch the natively generated id |
void |
beginRead()
Called just before reading any rows from the JDBC result set |
void |
delayedAddAll(Collection coll)
After reading all existing elements from the database, add the queued elements to the underlying collection. |
abstract boolean |
empty()
Is the initialized collection empty? |
boolean |
endRead()
Called after reading all rows from the JDBC result set |
void |
forceInitialization()
To be called internally by the session, forcing immediate initialization. |
CollectionSnapshot |
getCollectionSnapshot()
Returns the collectionSnapshot. |
Object |
getIdentifier(Object entry,
int i)
Get the index of the given collection entry |
protected static Collection |
getOrphans(Collection oldElements,
Collection currentElements,
String entityName,
SessionImplementor session)
|
abstract Collection |
getOrphans(Serializable snapshot,
String entityName)
get all "orphaned" elements |
Object |
getOwner()
|
protected SessionImplementor |
getSession()
Get the current session |
protected Serializable |
getSnapshot()
Get the current snapshot from the session |
Serializable |
getSnapshot(CollectionPersister persister)
Return a new snapshot of the current state of the collection, or null if no persister is passed |
Object |
getValue()
return the user-visible collection (or array) instance |
boolean |
hasQueuedAdditions()
Does this instance have any "queued" additions? |
protected void |
initialize(boolean writing)
Initialize the collection, if possible, wrapping any exceptions in a runtime exception |
boolean |
isDirectlyAccessible()
Could the application possibly have a direct reference to the underlying collection implementation? |
boolean |
isRowUpdatePossible()
|
boolean |
needsRecreate(CollectionPersister persister)
Do we need to completely recreate this collection when it changes? |
void |
postFlush()
After flushing, clear any "queued" additions, since the database state is now synchronized with the memory state. |
void |
preInsert(CollectionPersister persister)
Called before inserting rows, to ensure that any surrogate keys are fully generated |
protected boolean |
queueAdd(Object element)
Queue an addition |
protected boolean |
queueAddAll(Collection coll)
Queue additions |
Iterator |
queuedAdditionIterator()
Iterate the "queued" additions |
protected void |
read()
Called by any read-only method of the collection interface |
void |
setCollectionSnapshot(CollectionSnapshot collectionSnapshot)
Sets the collectionSnapshot. |
boolean |
setCurrentSession(SessionImplementor session)
Associate the collection with the given session. |
protected void |
setDirectlyAccessible(boolean directlyAccessible)
|
protected void |
setInitialized()
|
void |
setOwner(Object owner)
|
protected abstract Serializable |
snapshot(CollectionPersister persister)
Return a new snapshot of the current state |
boolean |
unsetSession(SessionImplementor currentSession)
Disassociate this collection from the given session. |
boolean |
wasInitialized()
Is this instance initialized? |
protected void |
write()
Called by any writer method of the collection interface |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.hibernate.collection.PersistentCollection |
beforeInitialize, disassemble, entries, entryExists, equalsSnapshot, getDeletes, getElement, getIndex, getSnapshotElement, initializeFromCache, isWrapper, needsInserting, needsUpdating, readFrom |
| Constructor Detail |
public AbstractPersistentCollection()
protected AbstractPersistentCollection(SessionImplementor session)
| Method Detail |
public abstract boolean empty()
empty in interface PersistentCollectionprotected final void read()
protected final void write()
protected final boolean queueAdd(Object element)
protected final boolean queueAddAll(Collection coll)
public void delayedAddAll(Collection coll)
public void postFlush()
postFlush in interface PersistentCollectionpublic Object getValue()
getValue in interface PersistentCollectionpublic void beginRead()
beginRead in interface PersistentCollectionpublic boolean endRead()
endRead in interface PersistentCollectionprotected final void initialize(boolean writing)
writing - currently obsolete
LazyInitializationException - if we cannot initializeprotected final void setInitialized()
protected final void setDirectlyAccessible(boolean directlyAccessible)
public boolean isDirectlyAccessible()
isDirectlyAccessible in interface PersistentCollectionpublic final boolean unsetSession(SessionImplementor currentSession)
unsetSession in interface PersistentCollection
public final boolean setCurrentSession(SessionImplementor session)
throws HibernateException
setCurrentSession in interface PersistentCollectionHibernateException - if the collection was already associated
with another open sessionpublic boolean needsRecreate(CollectionPersister persister)
needsRecreate in interface PersistentCollection
public final Serializable getSnapshot(CollectionPersister persister)
throws HibernateException
getSnapshot in interface PersistentCollectionHibernateException
protected abstract Serializable snapshot(CollectionPersister persister)
throws HibernateException
HibernateException
public final void forceInitialization()
throws HibernateException
forceInitialization in interface PersistentCollectionHibernateExceptionprotected final Serializable getSnapshot()
public final boolean wasInitialized()
wasInitialized in interface PersistentCollectionpublic boolean isRowUpdatePossible()
isRowUpdatePossible in interface PersistentCollectionpublic final boolean hasQueuedAdditions()
hasQueuedAdditions in interface PersistentCollectionpublic final Iterator queuedAdditionIterator()
queuedAdditionIterator in interface PersistentCollectionpublic CollectionSnapshot getCollectionSnapshot()
getCollectionSnapshot in interface PersistentCollectionpublic void setCollectionSnapshot(CollectionSnapshot collectionSnapshot)
setCollectionSnapshot in interface PersistentCollectioncollectionSnapshot - The collectionSnapshot to set
public void preInsert(CollectionPersister persister)
throws HibernateException
preInsert in interface PersistentCollectionHibernateException
public void afterRowInsert(CollectionPersister persister,
Object entry,
int i)
throws HibernateException
afterRowInsert in interface PersistentCollectionHibernateException
public abstract Collection getOrphans(Serializable snapshot,
String entityName)
throws HibernateException
getOrphans in interface PersistentCollectionentityName - TODO
HibernateExceptionprotected final SessionImplementor getSession()
protected static Collection getOrphans(Collection oldElements,
Collection currentElements,
String entityName,
SessionImplementor session)
throws HibernateException
HibernateException
public Object getIdentifier(Object entry,
int i)
PersistentCollection
getIdentifier in interface PersistentCollectionpublic Object getOwner()
getOwner in interface PersistentCollectionpublic void setOwner(Object owner)
setOwner in interface PersistentCollection
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||