Class MapProperty<K,V extends Persistent>

java.lang.Object
org.apache.cayenne.exp.property.BaseProperty<Map<K,V>>
org.apache.cayenne.exp.property.MapProperty<K,V>
All Implemented Interfaces:
PathProperty<Map<K,V>>, Property<Map<K,V>>, RelationshipProperty<Map<K,V>>

public class MapProperty<K,V extends Persistent> extends BaseProperty<Map<K,V>> implements RelationshipProperty<Map<K,V>>
Property that represents to-many relationship mapped on Map.
Since:
4.2
See Also:
  • Field Details

  • Constructor Details

  • 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(Painting.class))
                .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

      @Deprecated(since="5.0", forRemoval=true) @SafeVarargs public final 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.
    • containsValues

      @SafeVarargs public final Expression containsValues(V... values)
      Returns:
      An expression for finding objects with values in the given set.
      Since:
      5.0
    • 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.
    • containsValuesCollection

      public Expression containsValuesCollection(Collection<V> values)
      Returns:
      An expression for finding objects with values in the given set.
      Since:
      5.0
    • 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.
    • notContainsValuesCollection

      public Expression notContainsValuesCollection(Collection<V> values)
      Returns:
      An expression for finding objects with values in the given set.
      Since:
      5.0
    • 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.
    • notContainsValues

      @SafeVarargs public final Expression notContainsValues(V... values)
      Returns:
      An expression for finding objects with values not in the given set.
      Since:
      5.0
    • 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
    • containsIds

      public Expression containsIds(Object... ids)
      Returns:
      An expression for finding objects with given id set
      Since:
      5.0
    • 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.
    • containsIdsCollection

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

      public Expression notContainsIds(Object... ids)
      Returns:
      An expression for finding objects without given id set.
      Since:
      5.0
    • 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.
    • notContainsIdsCollection

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

      public MapProperty<K,V> alias(String alias)
      Creates alias with different name for this property
      Overrides:
      alias in class BaseProperty<Map<K,V extends Persistent>>
    • outer

      public MapProperty<K,V> outer()
      Returns a version of this property that represents an OUTER join.
      Specified by:
      outer in interface RelationshipProperty<K>
    • getKeyType

      protected Class<K> getKeyType()
      Returns:
      type of keys in represented attribute
    • getEntityType

      protected Class<V> getEntityType()
      Returns:
      type of object entity in represented attribute
    • enclosing

      public MapProperty<K,V> enclosing()
      Description copied from class: BaseProperty
      This operator allows to access properties of the enclosing query from the subquery. It allows multiple nesting levels to access a corresponding query in case of multiple levels of subqueries. Example:
      
       ObjectSelect.query(Artist.class)
                       .where(ExpressionFactory.notExists(ObjectSelect.query(Painting.class)
                               .where(Painting.TO_ARTIST.eq(Artist.ARTIST_ID_PK_PROPERTY.enclosing()))))
       
       
      Overrides:
      enclosing in class BaseProperty<Map<K,V extends Persistent>>
      Returns:
      property that will be translated relative to parent query