Top Description Fields Constructors Methods
org.hibernate.collection

public Class PersistentElementHolder

extends AbstractPersistentCollection
Class Inheritance
Imports
java.io.Serializable, java.sql.ResultSet, .SQLException, java.util.ArrayList, .Collection, .Iterator, .List, org.dom4j.Element, org.hibernate.AssertionFailure, .HibernateException, org.hibernate.loader.CollectionAliases, org.hibernate.engine.SessionImplementor, org.hibernate.persister.collection.CollectionPersister, org.hibernate.type.Type, org.hibernate.util.CollectionHelper

A persistent wrapper for an XML element
Author
Gavin King

Field Summary

Modifier and TypeField and Description
protected Element
Inherited from org.hibernate.collection.AbstractPersistentCollection:
UNKNOWN

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
beforeInitialize(CollectionPersister
The underlying collection persister.
persister
,
int
The anticipated size of the collection after initilization is complete.
anticipatedSize
)

Implements org.hibernate.collection.PersistentCollection.beforeInitialize.

Called before any elements are read into the collection, allowing appropriate initializations to occur.
public Serializable
disassemble(CollectionPersister persister)

Implements org.hibernate.collection.PersistentCollection.disassemble.

Disassemble the collection, ready for the cache
public boolean
public Iterator<E>
entries(CollectionPersister persister)

Implements org.hibernate.collection.PersistentCollection.entries.

Iterate all collection entries, during update of the database
public boolean
entryExists(Object entry, int i)

Implements org.hibernate.collection.PersistentCollection.entryExists.

Does an element exist at this entry in the collection?
public boolean
equalsSnapshot(CollectionPersister persister)

Implements org.hibernate.collection.PersistentCollection.equalsSnapshot.

Does the current state exactly match the snapshot?
public Iterator<E>
getDeletes(CollectionPersister persister, boolean indexIsFormula)

Implements org.hibernate.collection.PersistentCollection.getDeletes.

Get all the elements that need deleting
public Object
getElement(Object entry)

Implements org.hibernate.collection.PersistentCollection.getElement.

Get the value of the given collection entry
public Object
getIndex(Object entry, int i, CollectionPersister
it was more elegant before we added this...
persister
)

Implements org.hibernate.collection.PersistentCollection.getIndex.

Get the index of the given collection entry
public Collection<E>
public Serializable
getSnapshot(CollectionPersister persister)

Implements org.hibernate.collection.PersistentCollection.getSnapshot.

Return a new snapshot of the current state of the collection
public Object
getSnapshotElement(Object entry, int i)

Implements org.hibernate.collection.PersistentCollection.getSnapshotElement.

Get the snapshot value of the given collection entry
public Object
public void
initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner)

Implements org.hibernate.collection.PersistentCollection.initializeFromCache.

Read the state of the collection from a disassembled cached value
public boolean
isDirectlyAccessible()

Overrides org.hibernate.collection.AbstractPersistentCollection.isDirectlyAccessible.

Implements org.hibernate.collection.PersistentCollection.isDirectlyAccessible.

Could the application possibly have a direct reference to the underlying collection implementation?
public boolean
public boolean
isWrapper(Object collection)

Implements org.hibernate.collection.PersistentCollection.isWrapper.

Is this the wrapper for the given underlying collection instance?
public boolean
needsInserting(Object entry, int i, Type elementType)

Implements org.hibernate.collection.PersistentCollection.needsInserting.

Do we need to insert this element?
public boolean
needsUpdating(Object entry, int i, Type elementType)

Implements org.hibernate.collection.PersistentCollection.needsUpdating.

Do we need to update this element?
public Object
readFrom(ResultSet rs, CollectionPersister persister, CollectionAliases descriptor, Object owner)

Implements org.hibernate.collection.PersistentCollection.readFrom.

Read a row from the JDBC result set
Inherited from org.hibernate.collection.AbstractPersistentCollection:
afterInitializeafterRowInsertbeginReadclearDirtydirtyendReadforceInitializationgetCachedSizegetIdentifiergetKeygetOrphansgetOwnergetQueuedOrphansgetRolegetSessiongetSnapshotgetStoredSnapshothasQueuedOperationsidentityRemoveinitializeisClearQueueEnabledisDirtyisOperationQueueEnabledisPutQueueEnabledisRowUpdatePossibleisUnreferencedneedsRecreateperformQueuedOperationspostActionpreInsertqueuedAdditionIteratorqueueOperationreadreadElementByIndexreadElementExistencereadIndexExistencereadSizesetCurrentSessionsetDirectlyAccessiblesetInitializedsetOwnersetSnapshotunsetSessionwasInitializedwrite

Field Detail

elementback to summary
protected Element element

Constructor Detail

PersistentElementHolderback to summary
public PersistentElementHolder(SessionImplementor session, Element element)
PersistentElementHolderback to summary
public PersistentElementHolder(SessionImplementor session, CollectionPersister persister, Serializable key) throws HibernateException

Method Detail

beforeInitializeback to summary
public void beforeInitialize(CollectionPersister persister, int anticipatedSize)

Implements org.hibernate.collection.PersistentCollection.beforeInitialize.

Doc from org.hibernate.collection.PersistentCollection.beforeInitialize.

Called before any elements are read into the collection, allowing appropriate initializations to occur.

Parameters
persister:CollectionPersister

The underlying collection persister.

anticipatedSize:int

The anticipated size of the collection after initilization is complete.

disassembleback to summary
public Serializable disassemble(CollectionPersister persister) throws HibernateException

Implements org.hibernate.collection.PersistentCollection.disassemble.

Doc from org.hibernate.collection.PersistentCollection.disassemble.

Disassemble the collection, ready for the cache

emptyback to summary
public boolean empty()

Implements abstract org.hibernate.collection.AbstractPersistentCollection.empty.

Implements org.hibernate.collection.PersistentCollection.empty.

Doc from org.hibernate.collection.AbstractPersistentCollection.empty.

Is the initialized collection empty?

entriesback to summary
public Iterator<E> entries(CollectionPersister persister)

Implements org.hibernate.collection.PersistentCollection.entries.

Doc from org.hibernate.collection.PersistentCollection.entries.

Iterate all collection entries, during update of the database

entryExistsback to summary
public boolean entryExists(Object entry, int i)

Implements org.hibernate.collection.PersistentCollection.entryExists.

Doc from org.hibernate.collection.PersistentCollection.entryExists.

Does an element exist at this entry in the collection?

equalsSnapshotback to summary
public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException

Implements org.hibernate.collection.PersistentCollection.equalsSnapshot.

Doc from org.hibernate.collection.PersistentCollection.equalsSnapshot.

Does the current state exactly match the snapshot?

getDeletesback to summary
public Iterator<E> getDeletes(CollectionPersister persister, boolean indexIsFormula) throws HibernateException

Implements org.hibernate.collection.PersistentCollection.getDeletes.

Doc from org.hibernate.collection.PersistentCollection.getDeletes.

Get all the elements that need deleting

getElementback to summary
public Object getElement(Object entry)

Implements org.hibernate.collection.PersistentCollection.getElement.

Doc from org.hibernate.collection.PersistentCollection.getElement.

Get the value of the given collection entry

getIndexback to summary
public Object getIndex(Object entry, int i, CollectionPersister persister)

Implements org.hibernate.collection.PersistentCollection.getIndex.

Doc from org.hibernate.collection.PersistentCollection.getIndex.

Get the index of the given collection entry

Parameters
persister:CollectionPersister

it was more elegant before we added this...

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

Implements abstract org.hibernate.collection.AbstractPersistentCollection.getOrphans.

Implements org.hibernate.collection.PersistentCollection.getOrphans.

Doc from org.hibernate.collection.AbstractPersistentCollection.getOrphans.

get all "orphaned" elements

getSnapshotback to summary
public Serializable getSnapshot(CollectionPersister persister) throws HibernateException

Implements org.hibernate.collection.PersistentCollection.getSnapshot.

Doc from org.hibernate.collection.PersistentCollection.getSnapshot.

Return a new snapshot of the current state of the collection

getSnapshotElementback to summary
public Object getSnapshotElement(Object entry, int i)

Implements org.hibernate.collection.PersistentCollection.getSnapshotElement.

Doc from org.hibernate.collection.PersistentCollection.getSnapshotElement.

Get the snapshot value of the given collection entry

getValueback to summary
public Object getValue()

Overrides org.hibernate.collection.AbstractPersistentCollection.getValue.

Implements org.hibernate.collection.PersistentCollection.getValue.

Doc from org.hibernate.collection.AbstractPersistentCollection.getValue.

return the user-visible collection (or array) instance

initializeFromCacheback to summary
public void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner) throws HibernateException

Implements org.hibernate.collection.PersistentCollection.initializeFromCache.

Doc from org.hibernate.collection.PersistentCollection.initializeFromCache.

Read the state of the collection from a disassembled cached value

isDirectlyAccessibleback to summary
public boolean isDirectlyAccessible()

Overrides org.hibernate.collection.AbstractPersistentCollection.isDirectlyAccessible.

Implements org.hibernate.collection.PersistentCollection.isDirectlyAccessible.

Doc from org.hibernate.collection.AbstractPersistentCollection.isDirectlyAccessible.

Could the application possibly have a direct reference to the underlying collection implementation?

isSnapshotEmptyback to summary
public boolean isSnapshotEmpty(Serializable snapshot)

Implements org.hibernate.collection.PersistentCollection.isSnapshotEmpty.

Doc from org.hibernate.collection.PersistentCollection.isSnapshotEmpty.

Is the snapshot empty?

isWrapperback to summary
public boolean isWrapper(Object collection)

Implements org.hibernate.collection.PersistentCollection.isWrapper.

Doc from org.hibernate.collection.PersistentCollection.isWrapper.

Is this the wrapper for the given underlying collection instance?

needsInsertingback to summary
public boolean needsInserting(Object entry, int i, Type elementType) throws HibernateException

Implements org.hibernate.collection.PersistentCollection.needsInserting.

Doc from org.hibernate.collection.PersistentCollection.needsInserting.

Do we need to insert this element?

needsUpdatingback to summary
public boolean needsUpdating(Object entry, int i, Type elementType) throws HibernateException

Implements org.hibernate.collection.PersistentCollection.needsUpdating.

Doc from org.hibernate.collection.PersistentCollection.needsUpdating.

Do we need to update this element?

readFromback to summary
public Object readFrom(ResultSet rs, CollectionPersister persister, CollectionAliases descriptor, Object owner) throws HibernateException, SQLException

Implements org.hibernate.collection.PersistentCollection.readFrom.

Doc from org.hibernate.collection.PersistentCollection.readFrom.

Read a row from the JDBC result set