Package org.apache.cayenne.exp.property

## Class CollectionProperty<V extends Persistent,​E extends Collection<V>>

- java.lang.Object
- - org.apache.cayenne.exp.property.BaseProperty<E>
  - - org.apache.cayenne.exp.property.CollectionProperty<V,​E>

- All Implemented Interfaces:
    `PathProperty<E>`, `Property<E>`, `RelationshipProperty<E>`
  Direct Known Subclasses:
    `ListProperty`, `SetProperty`

      public abstract class CollectionProperty<V extends Persistent,​E extends Collection<V>>
      extends BaseProperty<E>
      implements RelationshipProperty<E>

  Base class for `ListProperty` and `SetProperty`
  Since:
    4.2

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected Class<V>` | `entityType` |

    - ### Fields inherited from class org.apache.cayenne.exp.property.BaseProperty

      `expressionSupplier, name, type`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `CollectionProperty​(String name, Expression expression, Class<? super E> collectionType, Class<V> entityType)` | Constructs a new property with the given name and expression

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Expression` | `contains​(Collection<V> values)` |
    `Expression` | `contains​(V value)` |
    `Expression` | `contains​(V firstValue, V... moreValues)` |
    `Expression` | `containsId​(Object id)` |
    `Expression` | `containsId​(Object firstId, Object... moreId)` |
    `Expression` | `containsId​(Collection<Object> ids)` |
    `EntityProperty<V>` | `flat()` | Create new "flat" property for toMany relationship.
    `protected Class<V>` | `getEntityType()` |
    `Expression` | `notContains​(Collection<V> values)` |
    `Expression` | `notContains​(V value)` |
    `Expression` | `notContains​(V firstValue, V... moreValues)` |
    `Expression` | `notContainsId​(Object id)` |
    `Expression` | `notContainsId​(Object firstId, Object... moreId)` |
    `Expression` | `notContainsId​(Collection<Object> ids)` |

    - ### Methods inherited from class org.apache.cayenne.exp.property.BaseProperty

      `alias, asc, ascInsensitive, ascInsensitives, ascs, count, countDistinct, desc, descInsensitive, descInsensitives, descs, enclosing, eq, eq, equals, function, function, getAlias, getExpression, getFrom, getFromAll, getName, getType, hashCode, in, in, in, isFalse, isNotNull, isNull, isTrue, ne, ne, nin, nin, nin, operator, operator, path, setIn, setInAll`

    - ### Methods inherited from class java.lang.Object

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

    - ### Methods inherited from interface org.apache.cayenne.exp.property.PathProperty

      `dot, dot, dot, dot, dot`

    - ### Methods inherited from interface org.apache.cayenne.exp.property.Property

      `getAlias, getExpression, getName, getType`

    - ### Methods inherited from interface org.apache.cayenne.exp.property.RelationshipProperty

      `disjoint, disjointById, dot, dot, dot, dot, dot, dot, dot, joint, outer`

- - ### Field Detail

    - #### entityType

          protected Class<V extends Persistent> entityType

  - ### Constructor Detail

    - #### CollectionProperty

          protected CollectionProperty​(String name,
                                       Expression expression,
                                       Class<? super E> collectionType,
                                       Class<V> entityType)

      Constructs a new property with the given name and expression
      Parameters:
        `name` - of the property (will be used as alias for the expression)
        `expression` - expression for property
        `collectionType` - type of the collection
        `entityType` - type of related entity

  - ### Method Detail

    - #### flat

          public EntityProperty<V> flat()

      Create new "flat" property for toMany relationship.

      Example:

           List<Object[]> result = ObjectSelect
                .columnQuery(Artist.class, Artist.ARTIST_NAME, Artist.PAINTING_ARRAY.flat())
                .select(context);

    - #### contains

          public Expression contains​(V value)

      Returns:
        An expression representing equality to a value.

    - #### notContains

          public Expression notContains​(V value)

      Returns:
        An expression representing inequality to a value.

    - #### contains

          @SafeVarargs
          public final Expression contains​(V firstValue,
                                           V... moreValues)

      Returns:
        An expression for finding objects with values in the given set.

    - #### contains

          public Expression contains​(Collection<V> values)

      Returns:
        An expression for finding objects with values in the given set.

    - #### containsId

          public Expression containsId​(Object id)

      Parameters:
        `id` - object id
      Returns:
        An expression for finding object with given id.

    - #### containsId

          public Expression containsId​(Object firstId,
                                       Object... moreId)

      Returns:
        An expression for finding objects with given id set

    - #### containsId

          public Expression containsId​(Collection<Object> ids)

      Returns:
        An expression for finding objects with given id set.

    - #### notContainsId

          public Expression notContainsId​(Object id)

      Parameters:
        `id` - object id
      Returns:
        An expression for finding object without given id.

    - #### notContainsId

          public Expression notContainsId​(Object firstId,
                                          Object... moreId)

      Returns:
        An expression for finding objects without given id set.

    - #### notContainsId

          public Expression notContainsId​(Collection<Object> ids)

      Returns:
        An expression for finding objects without given id set.

    - #### notContains

          public Expression notContains​(Collection<V> values)

      Returns:
        An expression for finding objects with values not in the given set.

    - #### notContains

          @SafeVarargs
          public final Expression notContains​(V firstValue,
                                              V... moreValues)

      Returns:
        An expression for finding objects with values not in the given set.

    - #### getEntityType

          protected Class<V> getEntityType()

      Returns:
        object entity type represented by this property