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 Details

  • Constructor Details

    • CollectionProperty

      protected CollectionProperty(CayennePath path, Expression expression, Class<? super E> collectionType, Class<V> entityType)
      Constructs a new property with the given name and expression
      Parameters:
      path - 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 Details

    • 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

      @Deprecated(since="5.0", forRemoval=true) public Expression contains(V value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 5.0 in favour of containsValue(V)
      Returns:
      An expression representing equality to a value.
    • notContains

      @Deprecated(since="5.0", forRemoval=true) public Expression notContains(V value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 5.0 in favour of notContainsValue(V)
      Returns:
      An expression representing equality to a value.
    • contains

      @Deprecated(since="5.0", forRemoval=true) public Expression contains(V firstValue, V... moreValues)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 5.0 in favour of containsValues(V...)
      Returns:
      An expression for finding objects with values in the given set.
    • contains

      @Deprecated(since="5.0", forRemoval=true) public Expression contains(Collection<V> values)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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

      @Deprecated(since="5.0", forRemoval=true) public Expression containsId(Object firstId, Object... moreId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 5.0 in favour of containsIds(Object...)
      Returns:
      An expression for finding objects with given id set
    • containsId

      @Deprecated(since="5.0", forRemoval=true) public Expression containsId(Collection<Object> ids)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 5.0 in favour of containsIdsCollection(Collection)
      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

      @Deprecated(since="5.0", forRemoval=true) public Expression notContainsId(Object firstId, Object... moreId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 5.0 in favour of notContainsIds(Object...)
      Returns:
      An expression for finding objects without given id set.
    • notContainsId

      @Deprecated(since="5.0", forRemoval=true) public Expression notContainsId(Collection<Object> ids)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      An expression for finding objects without given id set.
    • notContains

      @Deprecated(since="5.0", forRemoval=true) public Expression notContains(Collection<V> values)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      An expression for finding objects with values not in the given set.
    • notContains

      @Deprecated(since="5.0", forRemoval=true) @SafeVarargs public final Expression notContains(V firstValue, V... moreValues)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 5.0 in favour of notContainsValues(V...)
      Returns:
      An expression for finding objects with values not in the given set.
    • containsValue

      public Expression containsValue(V value)
      Returns:
      An expression representing equality to a value.
      Since:
      5.0
    • notContainsValue

      public Expression notContainsValue(V value)
      Returns:
      An expression representing inequality to a value.
      Since:
      5.0
    • containsValues

      @SafeVarargs public final Expression containsValues(V... values)
      Returns:
      An expression for finding objects with values in the given set.
      Since:
      5.0
    • containsValuesCollection

      public Expression containsValuesCollection(Collection<V> values)
      Returns:
      An expression for finding objects with values in the given set.
      Since:
      5.0
    • containsIds

      public Expression containsIds(Object... ids)
      Returns:
      An expression for finding objects with given id set
      Since:
      5.0
    • containsIdsCollection

      public Expression containsIdsCollection(Collection<?> ids)
      Returns:
      An expression for finding objects with given id set.
      Since:
      5.0
    • notContainsIds

      public Expression notContainsIds(Object... ids)
      Returns:
      An expression for finding objects with given id set
      Since:
      5.0
    • notContainsIdsCollection

      public Expression notContainsIdsCollection(Collection<?> ids)
      Returns:
      An expression for finding objects without given id set.
      Since:
      5.0
    • notContainsValuesCollection

      public Expression notContainsValuesCollection(Collection<V> values)
      Returns:
      An expression for finding objects with values not in the given set.
      Since:
      5.0
    • notContainsValues

      @SafeVarargs public final Expression notContainsValues(V... values)
      Returns:
      An expression for finding objects with values not in the given set.
      Since:
      5.0
    • getEntityType

      protected Class<V> getEntityType()
      Returns:
      object entity type represented by this property