# Package org.apache.cayenne.exp.property

package org.apache.cayenne.exp.property

### 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

- Related Packages
  Package
  Description
  org.apache.cayenne.exp
  Cayenne data expression classes.
  org.apache.cayenne.exp.parser
  Contains expression parser and other expression internals.
- 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`
  ComparableProperty<E>
  Interface (or "Trait") that provides basic functionality for comparable properties.
  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.
  IdProperty<E>
  Base class for properties mapped to PK
  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
  PathProperty<E>
  Property that represents path segment (relationship or embeddable).
  Property<E>
  Base interface for all types of properties
  PropertyFactory
  Factory class that produces all property types.
  RelationshipProperty<E>
  Interface (or "Trait") that provides basic functionality for all types of relationships.
  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