Package org.hibernate.collection
Class PersistentArrayHolder
java.lang.Object
org.hibernate.collection.AbstractPersistentCollection
org.hibernate.collection.PersistentArrayHolder
- All Implemented Interfaces:
Serializable,PersistentCollection
A persistent wrapper for an array. Lazy initialization
is NOT supported. Use of Hibernate arrays is not really
recommended.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.hibernate.collection.AbstractPersistentCollection
AbstractPersistentCollection.DelayedOperation -
Field Summary
FieldsFields inherited from class org.hibernate.collection.AbstractPersistentCollection
UNKNOWN -
Constructor Summary
ConstructorsConstructorDescriptionPersistentArrayHolder(SessionImplementor session, Object array) PersistentArrayHolder(SessionImplementor session, CollectionPersister persister) -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeInitialize(CollectionPersister persister, int anticipatedSize) Called before any elements are read into the collection, allowing appropriate initializations to occur.voidCalled just before reading any rows from the JDBC result setdisassemble(CollectionPersister persister) Disassemble the collection, ready for the cacheelements()booleanempty()Is the initialized collection empty?booleanendRead()Called after reading all rows from the JDBC result setentries(CollectionPersister persister) Iterate all collection entries, during update of the databasebooleanentryExists(Object entry, int i) Does an element exist at this entry in the collection?booleanequalsSnapshot(CollectionPersister persister) Does the current state exactly match the snapshot?getArray()getDeletes(CollectionPersister persister, boolean indexIsFormula) Get all the elements that need deletinggetElement(Object entry) Get the value of the given collection entrygetIndex(Object entry, int i, CollectionPersister persister) Get the index of the given collection entrygetOrphans(Serializable snapshot, String entityName) get all "orphaned" elementsgetSnapshot(CollectionPersister persister) Return a new snapshot of the current state of the collectiongetSnapshotElement(Object entry, int i) Get the snapshot value of the given collection entrygetValue()return the user-visible collection (or array) instancevoidinitializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner) Read the state of the collection from a disassembled cached valuebooleanCould the application possibly have a direct reference to the underlying collection implementation?booleanisSnapshotEmpty(Serializable snapshot) Is the snapshot empty?booleanIs this the wrapper for the given underlying collection instance?booleanneedsInserting(Object entry, int i, Type elemType) Do we need to insert this element?booleanneedsUpdating(Object entry, int i, Type elemType) Do we need to update this element?readFrom(ResultSet rs, CollectionPersister persister, CollectionAliases descriptor, Object owner) Read a row from the JDBC result setMethods inherited from class org.hibernate.collection.AbstractPersistentCollection
afterInitialize, afterRowInsert, clearDirty, dirty, forceInitialization, getCachedSize, getIdentifier, getKey, getOrphans, getOwner, getQueuedOrphans, getRole, getSession, getSnapshot, getStoredSnapshot, hasQueuedOperations, initialize, isClearQueueEnabled, isDirty, isOperationQueueEnabled, isPutQueueEnabled, isRowUpdatePossible, isUnreferenced, needsRecreate, performQueuedOperations, postAction, preInsert, queuedAdditionIterator, queueOperation, read, readElementByIndex, readElementExistence, readIndexExistence, readSize, setCurrentSession, setDirectlyAccessible, setInitialized, setOwner, setSnapshot, unsetSession, wasInitialized, write
-
Field Details
-
array
-
-
Constructor Details
-
PersistentArrayHolder
-
PersistentArrayHolder
public PersistentArrayHolder(SessionImplementor session, CollectionPersister persister) throws HibernateException - Throws:
HibernateException
-
-
Method Details
-
getSnapshot
Description copied from interface:PersistentCollectionReturn a new snapshot of the current state of the collection- Throws:
HibernateException
-
isSnapshotEmpty
Description copied from interface:PersistentCollectionIs the snapshot empty? -
getOrphans
Description copied from class:AbstractPersistentCollectionget all "orphaned" elements- Specified by:
getOrphansin interfacePersistentCollection- Specified by:
getOrphansin classAbstractPersistentCollection- Throws:
HibernateException
-
getArray
-
isWrapper
Description copied from interface:PersistentCollectionIs this the wrapper for the given underlying collection instance? -
equalsSnapshot
Description copied from interface:PersistentCollectionDoes the current state exactly match the snapshot?- Throws:
HibernateException
-
elements
-
empty
public boolean empty()Description copied from class:AbstractPersistentCollectionIs the initialized collection empty?- Specified by:
emptyin interfacePersistentCollection- Specified by:
emptyin classAbstractPersistentCollection
-
readFrom
public Object readFrom(ResultSet rs, CollectionPersister persister, CollectionAliases descriptor, Object owner) throws HibernateException, SQLException Description copied from interface:PersistentCollectionRead a row from the JDBC result set- Throws:
HibernateExceptionSQLException
-
entries
Description copied from interface:PersistentCollectionIterate all collection entries, during update of the database -
beginRead
public void beginRead()Description copied from class:AbstractPersistentCollectionCalled just before reading any rows from the JDBC result set- Specified by:
beginReadin interfacePersistentCollection- Overrides:
beginReadin classAbstractPersistentCollection
-
endRead
public boolean endRead()Description copied from class:AbstractPersistentCollectionCalled after reading all rows from the JDBC result set- Specified by:
endReadin interfacePersistentCollection- Overrides:
endReadin classAbstractPersistentCollection
-
beforeInitialize
Description copied from interface:PersistentCollectionCalled before any elements are read into the collection, allowing appropriate initializations to occur.- Parameters:
persister- The underlying collection persister.anticipatedSize- The anticipated size of the collection after initilization is complete.
-
isDirectlyAccessible
public boolean isDirectlyAccessible()Description copied from class:AbstractPersistentCollectionCould the application possibly have a direct reference to the underlying collection implementation?- Specified by:
isDirectlyAccessiblein interfacePersistentCollection- Overrides:
isDirectlyAccessiblein classAbstractPersistentCollection
-
initializeFromCache
public void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner) throws HibernateException Description copied from interface:PersistentCollectionRead the state of the collection from a disassembled cached value- Throws:
HibernateException
-
disassemble
Description copied from interface:PersistentCollectionDisassemble the collection, ready for the cache- Throws:
HibernateException
-
getValue
Description copied from class:AbstractPersistentCollectionreturn the user-visible collection (or array) instance- Specified by:
getValuein interfacePersistentCollection- Overrides:
getValuein classAbstractPersistentCollection
-
getDeletes
public Iterator getDeletes(CollectionPersister persister, boolean indexIsFormula) throws HibernateException Description copied from interface:PersistentCollectionGet all the elements that need deleting- Throws:
HibernateException
-
needsInserting
Description copied from interface:PersistentCollectionDo we need to insert this element?- Throws:
HibernateException
-
needsUpdating
Description copied from interface:PersistentCollectionDo we need to update this element?- Throws:
HibernateException
-
getIndex
Description copied from interface:PersistentCollectionGet the index of the given collection entry- Parameters:
persister- it was more elegant before we added this...
-
getElement
Description copied from interface:PersistentCollectionGet the value of the given collection entry -
getSnapshotElement
Description copied from interface:PersistentCollectionGet the snapshot value of the given collection entry -
entryExists
Description copied from interface:PersistentCollectionDoes an element exist at this entry in the collection?
-