Top Description Fields Constructors Methods
org.hibernate.collection

public Class PersistentArrayHolder

extends AbstractPersistentCollection
Class Inheritance
Imports
java.io.Serializable, java.lang.reflect.Array, java.sql.ResultSet, .SQLException, java.util.ArrayList, .Collection, .Iterator, org.slf4j.Logger, .LoggerFactory, org.hibernate.EntityMode, .HibernateException, org.hibernate.loader.CollectionAliases, org.hibernate.engine.SessionImplementor, org.hibernate.persister.collection.CollectionPersister, org.hibernate.type.Type

A persistent wrapper for an array. Lazy initialization is NOT supported. Use of Hibernate arrays is not really recommended.
Author
Gavin King

Field Summary

Modifier and TypeField and Description
protected Object
private transient Class<T>
private static final Logger
private transient List<E>
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 void
beginRead()

Overrides org.hibernate.collection.AbstractPersistentCollection.beginRead.

Implements org.hibernate.collection.PersistentCollection.beginRead.

Called just before reading any rows from the JDBC result set
public Serializable
disassemble(CollectionPersister persister)

Implements org.hibernate.collection.PersistentCollection.disassemble.

Disassemble the collection, ready for the cache
public Iterator<E>
public boolean
public boolean
endRead()

Overrides org.hibernate.collection.AbstractPersistentCollection.endRead.

Implements org.hibernate.collection.PersistentCollection.endRead.

Called after reading all rows from the JDBC result set
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 Object
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 elemType)

Implements org.hibernate.collection.PersistentCollection.needsInserting.

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

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:
afterInitializeafterRowInsertclearDirtydirtyforceInitializationgetCachedSizegetIdentifiergetKeygetOrphansgetOwnergetQueuedOrphansgetRolegetSessiongetSnapshotgetStoredSnapshothasQueuedOperationsidentityRemoveinitializeisClearQueueEnabledisDirtyisOperationQueueEnabledisPutQueueEnabledisRowUpdatePossibleisUnreferencedneedsRecreateperformQueuedOperationspostActionpreInsertqueuedAdditionIteratorqueueOperationreadreadElementByIndexreadElementExistencereadIndexExistencereadSizesetCurrentSessionsetDirectlyAccessiblesetInitializedsetOwnersetSnapshotunsetSessionwasInitializedwrite

Field Detail

arrayback to summary
protected Object array
elementClassback to summary
private transient Class<T> elementClass
logback to summary
private static final Logger log
tempListback to summary
private transient List<E> tempList

Constructor Detail

PersistentArrayHolderback to summary
public PersistentArrayHolder(SessionImplementor session, Object array)
PersistentArrayHolderback to summary
public PersistentArrayHolder(SessionImplementor session, CollectionPersister persister) 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.

beginReadback to summary
public void beginRead()

Overrides org.hibernate.collection.AbstractPersistentCollection.beginRead.

Implements org.hibernate.collection.PersistentCollection.beginRead.

Doc from org.hibernate.collection.AbstractPersistentCollection.beginRead.

Called just before reading any rows from the JDBC result set

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

elementsback to summary
public Iterator<E> elements()
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?

endReadback to summary
public boolean endRead()

Overrides org.hibernate.collection.AbstractPersistentCollection.endRead.

Implements org.hibernate.collection.PersistentCollection.endRead.

Doc from org.hibernate.collection.AbstractPersistentCollection.endRead.

Called after reading all rows from the JDBC result set

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?

getArrayback to summary
public Object getArray()
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 elemType) 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 elemType) 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