Class ToManySet<E>
java.lang.Object
org.apache.cayenne.access.ToManyHolder<E>
org.apache.cayenne.access.ToManySet<E>
- All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>
A set that holds objects for to-many relationships, lazily resolved on first access.
- Since:
- 3.0
-
Field Summary
FieldsFields inherited from class ToManyHolder
addedToUnresolved, relationshipName, relationshipOwner, removedFromUnresolved -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends E> c) voidclear()booleanbooleancontainsAll(Collection<?> c) booleaninthashCode()voidTurns 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()booleanbooleanremoveAll(Collection<?> c) Returns internal objects set resolving it if needed.voidresolveWith(Collection<E> objects) Resolves the set with the given objects.booleanretainAll(Collection<?> c) intsize()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 Set
spliterator
-
Field Details
-
objectSet
-
-
Constructor Details
-
ToManySet
-
-
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 set with the given objects. A non-set collection (e.g. a prefetch result) is copied into a new set.- Specified by:
resolveWithin classToManyHolder<E>
-
resolvedObjectSet
-
add
-
addAll
-
clear
-
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>
-
equals
-
hashCode
-
isEmpty
-
iterator
-
remove
-
removeAll
-
retainAll
-
size
-
toArray
-
toArray
-
toString
-