Package org.hibernate.collection
Class PersistentList
java.lang.Object
org.hibernate.collection.AbstractPersistentCollection
org.hibernate.collection.PersistentList
- All Implemented Interfaces:
Serializable,Iterable,Collection,List,SequencedCollection,PersistentCollection
A persistent wrapper for a java.util.List. Underlying
collection is an ArrayList.
- 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
ConstructorsConstructorDescriptionPersistentList(SessionImplementor session) PersistentList(SessionImplementor session, List list) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection coll) booleanaddAll(Collection values) voidbeforeInitialize(CollectionPersister persister, int anticipatedSize) Called before any elements are read into the collection, allowing appropriate initializations to occur.voidclear()booleanbooleancontainsAll(Collection coll) disassemble(CollectionPersister persister) Disassemble the collection, ready for the cachebooleanempty()Is the initialized collection empty?entries(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?booleanbooleanequalsSnapshot(CollectionPersister persister) Does the current state exactly match the snapshot?get(int index) 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 entryinthashCode()intvoidinitializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner) Read the state of the collection from a disassembled cached valuebooleanisEmpty()booleanisSnapshotEmpty(Serializable snapshot) Is the snapshot empty?booleanIs this the wrapper for the given underlying collection instance?iterator()intlastIndexOf(Object value) listIterator(int index) 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 setremove(int index) booleanbooleanremoveAll(Collection coll) booleanretainAll(Collection coll) intsize()subList(int from, int to) Object[]toArray()Object[]toString()Methods inherited from class org.hibernate.collection.AbstractPersistentCollection
afterInitialize, afterRowInsert, beginRead, clearDirty, dirty, endRead, forceInitialization, getCachedSize, getIdentifier, getKey, getOrphans, getOwner, getQueuedOrphans, getRole, getSession, getSnapshot, getStoredSnapshot, getValue, hasQueuedOperations, initialize, isClearQueueEnabled, isDirectlyAccessible, isDirty, isOperationQueueEnabled, isPutQueueEnabled, isRowUpdatePossible, isUnreferenced, needsRecreate, performQueuedOperations, postAction, preInsert, queuedAdditionIterator, queueOperation, read, readElementByIndex, readElementExistence, readIndexExistence, readSize, setCurrentSession, setDirectlyAccessible, setInitialized, setOwner, setSnapshot, unsetSession, wasInitialized, writeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
-
Field Details
-
list
-
-
Constructor Details
-
PersistentList
-
PersistentList
-
PersistentList
public PersistentList()
-
-
Method Details
-
getSnapshot
Description copied from interface:PersistentCollectionReturn a new snapshot of the current state of the collection- Specified by:
getSnapshotin interfacePersistentCollection- Throws:
HibernateException
-
getOrphans
Description copied from class:AbstractPersistentCollectionget all "orphaned" elements- Specified by:
getOrphansin interfacePersistentCollection- Specified by:
getOrphansin classAbstractPersistentCollection- Throws:
HibernateException
-
equalsSnapshot
Description copied from interface:PersistentCollectionDoes the current state exactly match the snapshot?- Specified by:
equalsSnapshotin interfacePersistentCollection- Throws:
HibernateException
-
isSnapshotEmpty
Description copied from interface:PersistentCollectionIs the snapshot empty?- Specified by:
isSnapshotEmptyin interfacePersistentCollection
-
beforeInitialize
Description copied from interface:PersistentCollectionCalled before any elements are read into the collection, allowing appropriate initializations to occur.- Specified by:
beforeInitializein interfacePersistentCollection- Parameters:
persister- The underlying collection persister.anticipatedSize- The anticipated size of the collection after initilization is complete.
-
isWrapper
Description copied from interface:PersistentCollectionIs this the wrapper for the given underlying collection instance?- Specified by:
isWrapperin interfacePersistentCollection
-
size
public int size()- Specified by:
sizein interfaceCollection- Specified by:
sizein interfaceList- See Also:
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection- Specified by:
isEmptyin interfaceList- See Also:
-
contains
- Specified by:
containsin interfaceCollection- Specified by:
containsin interfaceList- See Also:
-
iterator
-
toArray
- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceList- See Also:
-
toArray
- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceList- See Also:
-
add
- Specified by:
addin interfaceCollection- Specified by:
addin interfaceList- See Also:
-
remove
- Specified by:
removein interfaceCollection- Specified by:
removein interfaceList- See Also:
-
containsAll
- Specified by:
containsAllin interfaceCollection- Specified by:
containsAllin interfaceList- See Also:
-
addAll
- Specified by:
addAllin interfaceCollection- Specified by:
addAllin interfaceList- See Also:
-
addAll
-
removeAll
- Specified by:
removeAllin interfaceCollection- Specified by:
removeAllin interfaceList- See Also:
-
retainAll
- Specified by:
retainAllin interfaceCollection- Specified by:
retainAllin interfaceList- See Also:
-
clear
public void clear()- Specified by:
clearin interfaceCollection- Specified by:
clearin interfaceList- See Also:
-
get
-
set
-
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList- See Also:
-
listIterator
- Specified by:
listIteratorin interfaceList- See Also:
-
listIterator
- Specified by:
listIteratorin interfaceList- See Also:
-
subList
-
empty
public boolean empty()Description copied from class:AbstractPersistentCollectionIs the initialized collection empty?- Specified by:
emptyin interfacePersistentCollection- Specified by:
emptyin classAbstractPersistentCollection
-
toString
-
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- Specified by:
readFromin interfacePersistentCollection- Throws:
HibernateExceptionSQLException
-
entries
Description copied from interface:PersistentCollectionIterate all collection entries, during update of the database- Specified by:
entriesin interfacePersistentCollection
-
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- Specified by:
initializeFromCachein interfacePersistentCollection- Throws:
HibernateException
-
disassemble
Description copied from interface:PersistentCollectionDisassemble the collection, ready for the cache- Specified by:
disassemblein interfacePersistentCollection- Throws:
HibernateException
-
getDeletes
public Iterator getDeletes(CollectionPersister persister, boolean indexIsFormula) throws HibernateException Description copied from interface:PersistentCollectionGet all the elements that need deleting- Specified by:
getDeletesin interfacePersistentCollection- Throws:
HibernateException
-
needsInserting
Description copied from interface:PersistentCollectionDo we need to insert this element?- Specified by:
needsInsertingin interfacePersistentCollection- Throws:
HibernateException
-
needsUpdating
Description copied from interface:PersistentCollectionDo we need to update this element?- Specified by:
needsUpdatingin interfacePersistentCollection- Throws:
HibernateException
-
getIndex
Description copied from interface:PersistentCollectionGet the index of the given collection entry- Specified by:
getIndexin interfacePersistentCollection- Parameters:
persister- it was more elegant before we added this...
-
getElement
Description copied from interface:PersistentCollectionGet the value of the given collection entry- Specified by:
getElementin interfacePersistentCollection
-
getSnapshotElement
Description copied from interface:PersistentCollectionGet the snapshot value of the given collection entry- Specified by:
getSnapshotElementin interfacePersistentCollection
-
equals
-
hashCode
public int hashCode() -
entryExists
Description copied from interface:PersistentCollectionDoes an element exist at this entry in the collection?- Specified by:
entryExistsin interfacePersistentCollection
-