Class ToManyList<E>
java.lang.Object
org.apache.cayenne.access.ToManyHolder<E>
org.apache.cayenne.access.ToManyList<E>
- All Implemented Interfaces:
Iterable<E>, Collection<E>, List<E>, SequencedCollection<E>
A list that holds objects for to-many relationships, lazily resolved on first access. All operations, except for
resolving the list from DB, are not synchronized. The safest way to implement custom synchronization is to
synchronize on parent ObjectStore.
-
Field Summary
FieldsFields inherited from class ToManyHolder
addedToUnresolved, relationshipName, relationshipOwner, removedFromUnresolved -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends E> c) booleanaddAll(Collection<? extends E> c) voidclear()booleanbooleancontainsAll(Collection<?> c) booleanget(int index) inthashCode()intvoidTurns this collection into a fault, thus forcing a refresh on the next access.booleanisEmpty()booleanisFault()Returns whether this collection is not yet resolved and requires a fetch.iterator()intlistIterator(int index) remove(int index) booleanbooleanremoveAll(Collection<?> c) Returns internal objects list resolving it if needed.voidresolveWith(Collection<E> objects) Resolves the list with the given objects.booleanretainAll(Collection<?> c) intsize()subList(int fromIndex, int toIndex) Object[]toArray()<T> T[]toArray(T[] a) toString()Methods inherited from class ToManyHolder
addLocal, isTransientParent, isUncommittedParent, mergeLocalChanges, removeLocal, resolveRelationshipMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
-
Field Details
-
objectList
-
-
Constructor Details
-
ToManyList
-
-
Method Details
-
isFault
public boolean isFault()Description copied from class:ToManyHolderReturns whether this collection is not yet resolved and requires a fetch.- Specified by:
isFaultin classToManyHolder<E>
-
invalidate
public void invalidate()Description copied from class:ToManyHolderTurns this collection into a fault, thus forcing a refresh on the next access.- Specified by:
invalidatein classToManyHolder<E>
-
resolveWith
Resolves the list with the given objects. A non-list collection is copied into a new list.- Specified by:
resolveWithin classToManyHolder<E>
-
resolvedObjectList
-
add
-
add
-
addAll
-
addAll
-
clear
-
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceList<E>
-
equals
-
hashCode
-
get
-
indexOf
-
isEmpty
-
iterator
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<E>
-
listIterator
- Specified by:
listIteratorin interfaceList<E>
-
listIterator
- Specified by:
listIteratorin interfaceList<E>
-
remove
-
remove
-
removeAll
-
retainAll
-
set
-
size
-
subList
-
toArray
-
toArray
-
toString
-