org.hibernate.collection

Class PersistentArrayHolder

Implemented Interfaces:
Serializable, PersistentCollection

public class PersistentArrayHolder
extends AbstractPersistentCollection

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

Nested Class Summary

Nested classes/interfaces inherited from class org.hibernate.collection.AbstractPersistentCollection

AbstractPersistentCollection.DelayedOperation

Field Summary

protected Object
array

Fields inherited from class org.hibernate.collection.AbstractPersistentCollection

UNKNOWN

Constructor Summary

PersistentArrayHolder(SessionImplementor session, Object array)
PersistentArrayHolder(SessionImplementor session, CollectionPersister persister)

Method Summary

void
beforeInitialize(CollectionPersister persister, int anticipatedSize)
void
beginRead()
Serializable
disassemble(CollectionPersister persister)
Iterator
elements()
boolean
empty()
boolean
endRead()
Iterator
entries(CollectionPersister persister)
boolean
entryExists(Object entry, int i)
boolean
equalsSnapshot(CollectionPersister persister)
Object
getArray()
Iterator
getDeletes(CollectionPersister persister, boolean indexIsFormula)
Object
getElement(Object entry)
Object
getIndex(Object entry, int i, CollectionPersister persister)
Collection
getOrphans(Serializable snapshot, String entityName)
Serializable
getSnapshot(CollectionPersister persister)
Object
getSnapshotElement(Object entry, int i)
Object
getValue()
void
initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner)
boolean
isDirectlyAccessible()
boolean
isSnapshotEmpty(Serializable snapshot)
boolean
isWrapper(Object collection)
boolean
needsInserting(Object entry, int i, Type elemType)
boolean
needsUpdating(Object entry, int i, Type elemType)
Object
readFrom(ResultSet rs, CollectionPersister persister, CollectionAliases descriptor, Object owner)

Methods inherited from class org.hibernate.collection.AbstractPersistentCollection

afterInitialize, afterRowInsert, beginRead, clearDirty, dirty, empty, endRead, forceInitialization, getCachedSize, getIdentifier, getKey, getOrphans, getOrphans, getOwner, getQueuedOrphans, getRole, getSession, getSnapshot, getStoredSnapshot, getValue, hasQueuedOperations, initialize, isClearQueueEnabled, isDirectlyAccessible, isDirty, isOperationQueueEnabled, isPutQueueEnabled, isRowUpdatePossible, isUnreferenced, needsRecreate, performQueuedOperations, postAction, preInsert, queueOperation, queuedAdditionIterator, read, readElementByIndex, readElementExistence, readIndexExistence, readSize, setCurrentSession, setDirectlyAccessible, setInitialized, setOwner, setSnapshot, unsetSession, wasInitialized, write

Field Details

array

protected Object array

Constructor Details

PersistentArrayHolder

public PersistentArrayHolder(SessionImplementor session,
                             Object array)

PersistentArrayHolder

public PersistentArrayHolder(SessionImplementor session,
                             CollectionPersister persister)
            throws HibernateException

Method Details

beforeInitialize

public void beforeInitialize(CollectionPersister persister,
                             int anticipatedSize)
Specified by:
beforeInitialize in interface PersistentCollection

beginRead

public void beginRead()
Specified by:
beginRead in interface PersistentCollection
Overrides:
beginRead in interface AbstractPersistentCollection

disassemble

public Serializable disassemble(CollectionPersister persister)
            throws HibernateException
Specified by:
disassemble in interface PersistentCollection

elements

public Iterator elements()

empty

public boolean empty()
Specified by:
empty in interface PersistentCollection
Overrides:
empty in interface AbstractPersistentCollection

endRead

public boolean endRead()
Specified by:
endRead in interface PersistentCollection
Overrides:
endRead in interface AbstractPersistentCollection

entries

public Iterator entries(CollectionPersister persister)
Specified by:
entries in interface PersistentCollection

entryExists

public boolean entryExists(Object entry,
                           int i)
Specified by:
entryExists in interface PersistentCollection

equalsSnapshot

public boolean equalsSnapshot(CollectionPersister persister)
            throws HibernateException
Specified by:
equalsSnapshot in interface PersistentCollection

getArray

public Object getArray()

getDeletes

public Iterator getDeletes(CollectionPersister persister,
                           boolean indexIsFormula)
            throws HibernateException
Specified by:
getDeletes in interface PersistentCollection

getElement

public Object getElement(Object entry)
Specified by:
getElement in interface PersistentCollection

getIndex

public Object getIndex(Object entry,
                       int i,
                       CollectionPersister persister)
Specified by:
getIndex in interface PersistentCollection

getOrphans

public Collection getOrphans(Serializable snapshot,
                             String entityName)
            throws HibernateException
Specified by:
getOrphans in interface PersistentCollection
Overrides:
getOrphans in interface AbstractPersistentCollection

getSnapshot

public Serializable getSnapshot(CollectionPersister persister)
            throws HibernateException
Specified by:
getSnapshot in interface PersistentCollection

getSnapshotElement

public Object getSnapshotElement(Object entry,
                                 int i)
Specified by:
getSnapshotElement in interface PersistentCollection

getValue

public Object getValue()
Specified by:
getValue in interface PersistentCollection
Overrides:
getValue in interface AbstractPersistentCollection

initializeFromCache

public void initializeFromCache(CollectionPersister persister,
                                Serializable disassembled,
                                Object owner)
            throws HibernateException
Specified by:
initializeFromCache in interface PersistentCollection

isDirectlyAccessible

public boolean isDirectlyAccessible()
Specified by:
isDirectlyAccessible in interface PersistentCollection
Overrides:
isDirectlyAccessible in interface AbstractPersistentCollection

isSnapshotEmpty

public boolean isSnapshotEmpty(Serializable snapshot)
Specified by:
isSnapshotEmpty in interface PersistentCollection

isWrapper

public boolean isWrapper(Object collection)
Specified by:
isWrapper in interface PersistentCollection

needsInserting

public boolean needsInserting(Object entry,
                              int i,
                              Type elemType)
            throws HibernateException
Specified by:
needsInserting in interface PersistentCollection

needsUpdating

public boolean needsUpdating(Object entry,
                             int i,
                             Type elemType)
            throws HibernateException
Specified by:
needsUpdating in interface PersistentCollection

readFrom

public Object readFrom(ResultSet rs,
                       CollectionPersister persister,
                       CollectionAliases descriptor,
                       Object owner)
            throws HibernateException,
                   SQLException
Specified by:
readFrom in interface PersistentCollection