# Package org.apache.cayenne.exp.property

Property API

See: Description

- Interface Summary
  Interface | Description
  --- | ---
  ComparableProperty<E> | Interface (or "Trait") that provides basic functionality for comparable properties.
  IdProperty<E> | Base class for properties mapped to PK
  PathProperty<E> | Property that represents path segment (relationship or embeddable).
  Property<E> | Base interface for all types of properties
  RelationshipProperty<E> | Interface (or "Trait") that provides basic functionality for all types of relationships.

- Class Summary
  Class | Description
  --- | ---
  BaseIdProperty<E> | Property that represents non-numeric PK
  BaseProperty<E> | Property that represents generic attribute.
  CollectionProperty<V extends Persistent,E extends Collection<V>> | Base class for `ListProperty` and `SetProperty`
  DateProperty<E> | Property that represents date/time attribute.
  EmbeddableProperty<E> | Property that represents object attribute mapped on `Embeddable` object.
  EntityProperty<E extends Persistent> | Property that represents to-one relationships.
  ListProperty<V extends Persistent> | Property that represents to-many relationship mapped on `List`.
  MapProperty<K,V extends Persistent> | Property that represents to-many relationship mapped on `Map`.
  NumericIdProperty<E extends Number> | Property that represents numeric PK
  NumericProperty<E extends Number> | Property that represents attributes mapped on numeric types
  PropertyFactory | Factory class that produces all property types.
  SetProperty<V extends Persistent> | Property that represents to-many relationship mapped on `Set`.
  StringProperty<E extends CharSequence> | Property that represents attributes mapped on string types

## Package org.apache.cayenne.exp.property Description

### Property API

This API allows to use type aware `expression` factories aka Properties.
These properties are normally generated as static constants in model classes, but they can also be created manually by `PropertyFactory` if needed.

Typical usage in select queries:

     Painting painting = ...
     Artist artist = ObjectSelect.query(Artist.class)
            .where(Artist.PAINTING_ARRAY.contains(painting))
            .and(Artist.DATE_OF_BIRTH.year().gt(1950))
            .and(Artist.ARTIST_NAME.like("Pablo%"))
            .orderBy(Artist.ARTIST_NAME.asc())
            .prefetch(Artist.PAINTING_ARRAY.disjointById())
            .selectOne(context);

Currently supported Property types:

- `NumericProperty` for all data types inherited from `Number`.
  Supports comparison and math functions (like `sqrt()`).
- `StringProperty` for all data types inherited from `CharSequence`.
  Supports multiple string functions (`like()`, `concat()`, etc.)
- `DateProperty` for `Date` (and `java.sql` variants) and `LocalDate`, `LocalTime`, `LocalDateTime`.
  Supports date functions like `year()`.
- `EntityProperty` for to-one relationships.
  Supports prefetch related methods, `dot()` methods, etc.
- `ListProperty`, `SetProperty` and `MapProperty` are for to-many relationships.
  In addition to to-one related methods these properties support collection comparison methods like `contains()`.
- `EmbeddableProperty` for embeddable objects
- `NumericIdProperty` for numeric PK properties
- `BaseIdProperty` for non-numeric PK properties
- `BaseProperty` for all other data types, supports basic operations (equality, sorting).

Since:
  4.2

Copyright © 2001–2021 Apache Cayenne. All rights reserved.