ToManyProperty (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne.reflect, interface: ToManyProperty

# Interface ToManyProperty

All Superinterfaces:
  `ArcProperty, PropertyDescriptor`

All Known Subinterfaces:
  `ToManyMapProperty`

All Known Implementing Classes:
  `BaseToManyProperty`

public interface ToManyProperty extends ArcProperty
A property representing a collection of objects.

Since:
  3.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addTarget(Object source, Object target, boolean setReverse)`
  `void`
  `addTargetDirectly(Object source, Object target)`
  Adds value to collection, without triggering changing events This method is mostly for internal use
  `void`
  `removeTarget(Object source, Object target, boolean setReverse)`
  `void`
  `removeTargetDirectly(Object source, Object target)`
  Removes value from collection, without triggering changing events This method is mostly for internal use

  ### Methods inherited from interface ArcProperty

  `getComplimentaryReverseArc, getComplimentaryReverseDbRelationshipPath, getRelationship, getTargetDescriptor, invalidate, isFault`
  Modifier and Type
  Method
  Description
  `ArcProperty`
  `getComplimentaryReverseArc()`
  Returns a complimentary reverse ArcProperty or null if no reverse arc exists.
  `String`
  `getComplimentaryReverseDbRelationshipPath()`
  Returns a path over reverse DbRelationships for this arc's ObjRelationship.
  `ObjRelationship`
  `getRelationship()`
  Returns a relationship associated with this arc.
  `ClassDescriptor`
  `getTargetDescriptor()`
  Returns a ClassDescriptor for the type of graph nodes pointed to by this arc property.
  `void`
  `invalidate(Object object)`
  Turns a property of an object into a fault.
  `boolean`
  `isFault(Object source)`
  Returns whether a target node connected to a given object is an unresolved fault.

  ### Methods inherited from interface PropertyDescriptor

  `equals, getName, injectValueHolder, readProperty, readPropertyDirectly, visit, writeProperty, writePropertyDirectly`
  Modifier and Type
  Method
  Description
  `default boolean`
  `equals(Object value1, Object value2)`
  Allows to use special logic to compare values for equality as in rare cases it is not sufficient to use the default equals() method.
  `String`
  `getName()`
  Returns property name.
  `void`
  `injectValueHolder(Object object)`
  If a property is implemented as a ValueHolder, this operation would create an unfaulted value holder and inject it into the object, if an object doesn't have it set yet.
  `Object`
  `readProperty(Object object)`
  Returns a property value, inflating unresolved object if need.
  `Object`
  `readPropertyDirectly(Object object)`
  Returns a property value of an object without disturbing the object fault status.
  `boolean`
  `visit(PropertyVisitor visitor)`
  A visitor accept method.
  `void`
  `writeProperty(Object object, Object oldValue, Object newValue)`
  Sets a property value, inflating unresolved object if need.
  `void`
  `writePropertyDirectly(Object object, Object oldValue, Object newValue)`
  Sets a property value of an object without disturbing the object fault status.

- ## Method Details

  - ### addTarget

    void addTarget(Object source, Object target, boolean setReverse) throws PropertyException
    Throws:
      `PropertyException`

  - ### removeTarget

    void removeTarget(Object source, Object target, boolean setReverse) throws PropertyException
    Throws:
      `PropertyException`

  - ### addTargetDirectly

    void addTargetDirectly(Object source, Object target) throws PropertyException
    Adds value to collection, without triggering changing events This method is mostly for internal use
    Throws:
      `PropertyException`
    Since:
      3.1

  - ### removeTargetDirectly

    void removeTargetDirectly(Object source, Object target) throws PropertyException
    Removes value from collection, without triggering changing events This method is mostly for internal use
    Throws:
      `PropertyException`
    Since:
      3.1