public abstract class AbstractPersistentCollection
extends java.lang.Object
implements java.io.Serializable, org.hibernate.collection.spi.PersistentCollection
PersistentCollection
This a extended copy of the original class from hibernate. It has been extended to
allow making remote service calls to spring httpinvoker services (see section at the bottom
of this class).Modifier and Type | Class and Description |
---|---|
protected static interface |
AbstractPersistentCollection.DelayedOperation
Contract for operations which are part of a collection's operation queue.
|
protected class |
AbstractPersistentCollection.IteratorProxy |
static interface |
AbstractPersistentCollection.LazyInitializationWork<T> |
protected class |
AbstractPersistentCollection.ListIteratorProxy |
protected class |
AbstractPersistentCollection.ListProxy |
protected class |
AbstractPersistentCollection.SetProxy |
Modifier and Type | Field and Description |
---|---|
protected static java.lang.Object |
UNKNOWN |
Modifier | Constructor and Description |
---|---|
|
AbstractPersistentCollection()
Not called by Hibernate, but used by non-JDK serialization,
eg.
|
protected |
AbstractPersistentCollection(org.hibernate.engine.spi.SessionImplementor session) |
Modifier and Type | Method and Description |
---|---|
boolean |
afterInitialize() |
void |
afterRowInsert(org.hibernate.persister.collection.CollectionPersister persister,
java.lang.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 |
clearDirty() |
void |
dirty() |
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.
|
protected int |
getCachedSize() |
java.lang.Object |
getIdentifier(java.lang.Object entry,
int i) |
java.io.Serializable |
getKey() |
protected static java.util.Collection |
getOrphans(java.util.Collection oldElements,
java.util.Collection currentElements,
java.lang.String entityName,
org.hibernate.engine.spi.SessionImplementor session)
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
|
abstract java.util.Collection |
getOrphans(java.io.Serializable snapshot,
java.lang.String entityName)
get all "orphaned" elements
|
java.lang.Object |
getOwner() |
java.util.Collection |
getQueuedOrphans(java.lang.String entityName)
Iterate the "queued" additions
|
java.lang.String |
getRole() |
org.hibernate.engine.spi.SessionImplementor |
getSession()
Get the current session
|
protected java.io.Serializable |
getSnapshot()
Get the current snapshot from the session
|
java.io.Serializable |
getStoredSnapshot() |
java.lang.Object |
getValue()
return the user-visible collection (or array) instance
|
boolean |
hasQueuedOperations()
Does this instance have any "queued" additions?
|
static void |
identityRemove(java.util.Collection list,
java.lang.Object object,
java.lang.String entityName,
org.hibernate.engine.spi.SessionImplementor session) |
protected void |
initialize(boolean writing)
Initialize the collection, if possible, wrapping any exceptions
in a runtime exception
|
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.
|
boolean |
isDirectlyAccessible()
Could the application possibly have a direct reference to
the underlying collection implementation?
|
boolean |
isDirty() |
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.
|
boolean |
isRowUpdatePossible() |
boolean |
isUnreferenced() |
boolean |
needsRecreate(org.hibernate.persister.collection.CollectionPersister persister)
Do we need to completely recreate this collection when it changes?
|
protected void |
performQueuedOperations()
After reading all existing elements from the database,
add the queued elements to the underlying collection.
|
void |
postAction()
After flushing, clear any "queued" additions, since the
database state is now synchronized with the memory state.
|
void |
preInsert(org.hibernate.persister.collection.CollectionPersister persister)
Called before inserting rows, to ensure that any surrogate keys
are fully generated
|
protected void |
prepareForPossibleSpecialSpecjInitialization() |
java.util.Iterator |
queuedAdditionIterator()
Iterate the "queued" additions
|
protected void |
queueOperation(AbstractPersistentCollection.DelayedOperation operation)
Queue an addition
|
protected void |
read()
Called by any read-only method of the collection interface
|
protected java.lang.Object |
readElementByIndex(java.lang.Object index) |
protected java.lang.Boolean |
readElementExistence(java.lang.Object element) |
protected java.lang.Boolean |
readIndexExistence(java.lang.Object index) |
protected boolean |
readSize()
Called by the
Collection.size() method |
static void |
setConfiguration(CdmApplicationRemoteConfiguration conf) |
boolean |
setCurrentSession(org.hibernate.engine.spi.SessionImplementor session)
Associate the collection with the given session.
|
protected void |
setDirectlyAccessible(boolean directlyAccessible) |
protected void |
setInitialized() |
void |
setOwner(java.lang.Object owner) |
void |
setSnapshot(java.io.Serializable key,
java.lang.String role,
java.io.Serializable snapshot)
After flushing, re-init snapshot state.
|
boolean |
unsetSession(org.hibernate.engine.spi.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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
beforeInitialize, disassemble, entries, entryExists, equalsSnapshot, getDeletes, getElement, getIndex, getSnapshot, getSnapshotElement, initializeFromCache, isSnapshotEmpty, isWrapper, needsInserting, needsUpdating, readFrom
public AbstractPersistentCollection()
protected AbstractPersistentCollection(org.hibernate.engine.spi.SessionImplementor session)
public final java.lang.String getRole()
getRole
in interface org.hibernate.collection.spi.PersistentCollection
public final java.io.Serializable getKey()
getKey
in interface org.hibernate.collection.spi.PersistentCollection
public final boolean isUnreferenced()
isUnreferenced
in interface org.hibernate.collection.spi.PersistentCollection
public final boolean isDirty()
isDirty
in interface org.hibernate.collection.spi.PersistentCollection
public final void clearDirty()
clearDirty
in interface org.hibernate.collection.spi.PersistentCollection
public final void dirty()
dirty
in interface org.hibernate.collection.spi.PersistentCollection
public final java.io.Serializable getStoredSnapshot()
getStoredSnapshot
in interface org.hibernate.collection.spi.PersistentCollection
public abstract boolean empty()
empty
in interface org.hibernate.collection.spi.PersistentCollection
protected final void read()
protected boolean readSize()
Collection.size()
methodprotected java.lang.Boolean readIndexExistence(java.lang.Object index)
protected java.lang.Boolean readElementExistence(java.lang.Object element)
protected java.lang.Object readElementByIndex(java.lang.Object index)
protected int getCachedSize()
protected final void write()
protected boolean isOperationQueueEnabled()
protected boolean isPutQueueEnabled()
protected boolean isClearQueueEnabled()
protected final void queueOperation(AbstractPersistentCollection.DelayedOperation operation)
protected final void performQueuedOperations()
public void setSnapshot(java.io.Serializable key, java.lang.String role, java.io.Serializable snapshot)
setSnapshot
in interface org.hibernate.collection.spi.PersistentCollection
public void postAction()
postAction
in interface org.hibernate.collection.spi.PersistentCollection
public java.lang.Object getValue()
getValue
in interface org.hibernate.collection.spi.PersistentCollection
public void beginRead()
beginRead
in interface org.hibernate.collection.spi.PersistentCollection
public boolean endRead()
endRead
in interface org.hibernate.collection.spi.PersistentCollection
public boolean afterInitialize()
afterInitialize
in interface org.hibernate.collection.spi.PersistentCollection
protected final void initialize(boolean writing)
writing
- currently obsoleteorg.hibernate.LazyInitializationException
- if we cannot initializeprotected final void setInitialized()
protected final void setDirectlyAccessible(boolean directlyAccessible)
public boolean isDirectlyAccessible()
isDirectlyAccessible
in interface org.hibernate.collection.spi.PersistentCollection
public final boolean unsetSession(org.hibernate.engine.spi.SessionImplementor currentSession)
unsetSession
in interface org.hibernate.collection.spi.PersistentCollection
protected void prepareForPossibleSpecialSpecjInitialization()
public final boolean setCurrentSession(org.hibernate.engine.spi.SessionImplementor session) throws org.hibernate.HibernateException
setCurrentSession
in interface org.hibernate.collection.spi.PersistentCollection
org.hibernate.HibernateException
- if the collection was already associated
with another open sessionpublic boolean needsRecreate(org.hibernate.persister.collection.CollectionPersister persister)
needsRecreate
in interface org.hibernate.collection.spi.PersistentCollection
public final void forceInitialization() throws org.hibernate.HibernateException
forceInitialization
in interface org.hibernate.collection.spi.PersistentCollection
org.hibernate.HibernateException
protected final java.io.Serializable getSnapshot()
public final boolean wasInitialized()
wasInitialized
in interface org.hibernate.collection.spi.PersistentCollection
public boolean isRowUpdatePossible()
isRowUpdatePossible
in interface org.hibernate.collection.spi.PersistentCollection
public final boolean hasQueuedOperations()
hasQueuedOperations
in interface org.hibernate.collection.spi.PersistentCollection
public final java.util.Iterator queuedAdditionIterator()
queuedAdditionIterator
in interface org.hibernate.collection.spi.PersistentCollection
public final java.util.Collection getQueuedOrphans(java.lang.String entityName)
getQueuedOrphans
in interface org.hibernate.collection.spi.PersistentCollection
public void preInsert(org.hibernate.persister.collection.CollectionPersister persister) throws org.hibernate.HibernateException
preInsert
in interface org.hibernate.collection.spi.PersistentCollection
org.hibernate.HibernateException
public void afterRowInsert(org.hibernate.persister.collection.CollectionPersister persister, java.lang.Object entry, int i) throws org.hibernate.HibernateException
afterRowInsert
in interface org.hibernate.collection.spi.PersistentCollection
org.hibernate.HibernateException
public abstract java.util.Collection getOrphans(java.io.Serializable snapshot, java.lang.String entityName) throws org.hibernate.HibernateException
getOrphans
in interface org.hibernate.collection.spi.PersistentCollection
org.hibernate.HibernateException
public final org.hibernate.engine.spi.SessionImplementor getSession()
protected static java.util.Collection getOrphans(java.util.Collection oldElements, java.util.Collection currentElements, java.lang.String entityName, org.hibernate.engine.spi.SessionImplementor session) throws org.hibernate.HibernateException
org.hibernate.HibernateException
public static void identityRemove(java.util.Collection list, java.lang.Object object, java.lang.String entityName, org.hibernate.engine.spi.SessionImplementor session) throws org.hibernate.HibernateException
org.hibernate.HibernateException
public java.lang.Object getIdentifier(java.lang.Object entry, int i)
getIdentifier
in interface org.hibernate.collection.spi.PersistentCollection
public java.lang.Object getOwner()
getOwner
in interface org.hibernate.collection.spi.PersistentCollection
public void setOwner(java.lang.Object owner)
setOwner
in interface org.hibernate.collection.spi.PersistentCollection
public static void setConfiguration(CdmApplicationRemoteConfiguration conf)
Copyright © 2007-2018. All Rights Reserved.