Class ToManyList<E>
java.lang.Object
org.apache.cayenne.util.RelationshipFault<E>
org.apache.cayenne.util.PersistentObjectList<E>
org.apache.cayenne.access.ToManyList<E>
- All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, List<E>, SequencedCollection<E>, PersistentObjectCollection<E>, ValueHolder<List<E>>
A list that holds objects for to-many relationships. 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.
- See Also:
-
Field Summary
Fields inherited from class PersistentObjectList
addedToUnresolved, objectList, removedFromUnresolvedFields inherited from class RelationshipFault
relationshipName, relationshipOwner -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninthashCode()protected voidpostprocessAdd(E addedObject) protected voidpostprocessAdd(Collection<? extends E> collection) protected voidpostprocessRemove(E removedObject) protected voidpostprocessRemove(Collection<? extends E> collection) protected booleantoString()protected voidupdateReverse(List<E> resolved) Methods inherited from class PersistentObjectList
add, add, addAll, addAll, addDirectly, addLocal, clear, clearLocalChanges, contains, containsAll, equals, get, getValue, getValueDirectly, indexOf, invalidate, isEmpty, isFault, iterator, lastIndexOf, listIterator, listIterator, mergeLocalChanges, remove, remove, removeAll, removeDirectly, removeLocal, resolvedObjectList, retainAll, set, setObjectList, setValue, setValueDirectly, size, subList, toArray, toArrayModifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends E> c) booleanaddAll(Collection<? extends E> c) voidaddDirectly(E target) Adds an object without triggering an eventprotected booleanvoidclear()protected voidbooleanbooleanbooleanget(int index) getValue()Returns an object stored by this ValueHolder.Retrieves ValueHolder value without triggering fault resolution.intvoidTurns itself into a fault, thus forcing a refresh on the next access.booleanisEmpty()booleanisFault()Returns whether this list is not yet resolved and requires a fetch.iterator()intlistIterator(int index) protected voidmergeLocalChanges(List<E> fetchedList) remove(int index) booleanbooleanremoveAll(Collection<?> c) voidremoveDirectly(E target) Removes an object without triggering an eventprotected booleanremoveLocal(E object) Returns internal objects list resolving it if needed.booleanretainAll(Collection<?> c) voidsetObjectList(List<E> objectList) Sets an object stored by this ValueHolder.setValueDirectly(List<E> value) Sets ValueHolder vaue without triggering fault resolution.intsize()subList(int fromIndex, int toIndex) Object[]toArray()<T> T[]toArray(T[] a) Methods inherited from class RelationshipFault
getRelationshipName, getRelationshipOwner, isTransientParent, isUncommittedParent, resolveFromDBModifier and TypeMethodDescriptionprotected booleanprotected booleanExecutes a query that returns related objects.Methods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
-
Constructor Details
-
ToManyList
-
-
Method Details
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<E>- Specified by:
hashCodein interfaceList<E>- Overrides:
hashCodein classPersistentObjectList<E>
-
shouldAddToRemovedFromUnresolvedList
- Overrides:
shouldAddToRemovedFromUnresolvedListin classPersistentObjectList<E>- Returns:
- whether object should be added to
PersistentObjectList.removedFromUnresolvedduring removal
-
toString
- Overrides:
toStringin classPersistentObjectList<E>
-
postprocessAdd
- Overrides:
postprocessAddin classPersistentObjectList<E>
-
postprocessRemove
- Overrides:
postprocessRemovein classPersistentObjectList<E>
-
postprocessAdd
- Overrides:
postprocessAddin classPersistentObjectList<E>
-
postprocessRemove
- Overrides:
postprocessRemovein classPersistentObjectList<E>
-
updateReverse
- Overrides:
updateReversein classRelationshipFault<E>
-