ToManySet (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne.access, class: ToManySet

# Class ToManySet<E>

java.lang.Object
org.apache.cayenne.util.RelationshipFault<E>
org.apache.cayenne.util.PersistentObjectSet<E>
org.apache.cayenne.access.ToManySet<E>

All Implemented Interfaces:
  `Serializable, Iterable<E>, Collection<E>, Set<E>, PersistentObjectCollection<E>, ValueHolder<Object>`

public class ToManySet<E> extends PersistentObjectSet<E> implements Serializable

See Also:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class PersistentObjectSet

  `addedToUnresolved, objectSet, removedFromUnresolved`
  Modifier and Type
  Field
  Description
  `protected Set<E>`
  `addedToUnresolved`
  `protected Set<E>`
  `objectSet`
  `protected Set<E>`
  `removedFromUnresolved`

  ### Fields inherited from class RelationshipFault

  `relationshipName, relationshipOwner`
  Modifier and Type
  Field
  Description
  `protected String`
  `relationshipName`
  `protected Persistent`
  `relationshipOwner`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `ToManySet(Persistent relationshipOwner, String relationshipName)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `postprocessAdd(E addedObject)`
  `protected void`
  `postprocessAdd(Collection<? extends E> collection)`
  `protected void`
  `postprocessRemove(E removedObject)`
  `protected void`
  `postprocessRemove(Collection<? extends E> collection)`
  `protected boolean`
  `shouldAddToRemovedFromUnresolvedSet(E object)`
  `protected void`
  `updateReverse(List<E> resolved)`

  ### Methods inherited from class PersistentObjectSet

  `add, addAll, addDirectly, clear, contains, containsAll, equals, getValue, getValueDirectly, hashCode, invalidate, isEmpty, isFault, iterator, mergeLocalChanges, remove, removeAll, removeDirectly, resolvedObjectSet, retainAll, setObjectSet, setValue, setValueDirectly, size, toArray, toArray, toString`
  Modifier and Type
  Method
  Description
  `boolean`
  `add(E o)`
  `boolean`
  `addAll(Collection<? extends E> c)`
  `void`
  `addDirectly(E target)`
  Adds an object without triggering an event
  `void`
  `clear()`
  `boolean`
  `contains(Object o)`
  `boolean`
  `containsAll(Collection c)`
  `boolean`
  `equals(Object o)`
  `Set<E>`
  `getValue()`
  Returns an object stored by this ValueHolder.
  `Set<E>`
  `getValueDirectly()`
  Retrieves ValueHolder value without triggering fault resolution.
  `int`
  `hashCode()`
  `void`
  `invalidate()`
  Turns itself into a fault, thus forcing a refresh on the next access.
  `boolean`
  `isEmpty()`
  `boolean`
  `isFault()`
  Returns whether this list is not yet resolved and requires a fetch.
  `Iterator<E>`
  `iterator()`
  `protected void`
  `mergeLocalChanges(List<E> resolved)`
  `boolean`
  `remove(Object o)`
  `boolean`
  `removeAll(Collection<?> c)`
  `void`
  `removeDirectly(E target)`
  Removes an object without triggering an event
  `protected Set<E>`
  `resolvedObjectSet()`
  Returns internal objects list resolving it if needed.
  `boolean`
  `retainAll(Collection<?> c)`
  `void`
  `setObjectSet(Set<E> objectSet)`
  `Object`
  `setValue(Object value)`
  Sets an object stored by this ValueHolder.
  `Object`
  `setValueDirectly(Object value)`
  Sets ValueHolder vaue without triggering fault resolution.
  `int`
  `size()`
  `Object[]`
  `toArray()`
  `<T> T[]`
  `toArray(T[] a)`
  `String`
  `toString()`

  ### Methods inherited from class RelationshipFault

  `getRelationshipName, getRelationshipOwner, isTransientParent, isUncommittedParent, resolveFromDB`
  Modifier and Type
  Method
  Description
  `String`
  `getRelationshipName()`
  `Persistent`
  `getRelationshipOwner()`
  `protected boolean`
  `isTransientParent()`
  `protected boolean`
  `isUncommittedParent()`
  `protected List<E>`
  `resolveFromDB()`
  Executes a query that returns related objects.

  ### Methods inherited from class Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface Collection

  `parallelStream, removeIf, stream, toArray`

  ### Methods inherited from interface Iterable

  `forEach`

  ### Methods inherited from interface Set

  `spliterator`

- ## Constructor Details

  - ### ToManySet

    protected ToManySet(Persistent relationshipOwner, String relationshipName)

- ## Method Details

  - ### shouldAddToRemovedFromUnresolvedSet

    protected boolean shouldAddToRemovedFromUnresolvedSet(E object)
    Overrides:
      `shouldAddToRemovedFromUnresolvedSet` in class `PersistentObjectSet<E>`

  - ### postprocessAdd

    protected void postprocessAdd(Collection<? extends E> collection)
    Overrides:
      `postprocessAdd` in class `PersistentObjectSet<E>`

  - ### postprocessRemove

    protected void postprocessRemove(Collection<? extends E> collection)
    Overrides:
      `postprocessRemove` in class `PersistentObjectSet<E>`

  - ### postprocessAdd

    protected void postprocessAdd(E addedObject)
    Overrides:
      `postprocessAdd` in class `PersistentObjectSet<E>`

  - ### postprocessRemove

    protected void postprocessRemove(E removedObject)
    Overrides:
      `postprocessRemove` in class `PersistentObjectSet<E>`

  - ### updateReverse

    protected void updateReverse(List<E> resolved)
    Overrides:
      `updateReverse` in class `RelationshipFault<E>`