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 fromNumber
.
Supports comparison and math functions (likesqrt()
).
StringProperty
for all data types inherited fromCharSequence
.
Supports multiple string functions (like()
,concat()
, etc.)
DateProperty
forDate
(andjava.sql
variants) andLocalDate
,LocalTime
,LocalDateTime
.
Supports date functions likeyear()
.
EntityProperty
for to-one relationships.
Supports prefetch related methods,dot()
methods, etc.
ListProperty
,SetProperty
andMapProperty
are for to-many relationships.
In addition to to-one related methods these properties support collection comparison methods likecontains()
.
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
-
ClassDescriptionProperty that represents non-numeric PKBaseProperty<E>Property that represents generic attribute.Base class for
ListProperty
andSetProperty
Interface (or "Trait") that provides basic functionality for comparable properties.DateProperty<E>Property that represents date/time attribute.Property that represents object attribute mapped onEmbeddable
object.EntityProperty<E extends Persistent>Property that represents to-one relationships.IdProperty<E>Base class for properties mapped to PKListProperty<V extends Persistent>Property that represents to-many relationship mapped onList
.MapProperty<K,V extends Persistent> Property that represents to-many relationship mapped onMap
.NumericIdProperty<E extends Number>Property that represents numeric PKNumericProperty<E extends Number>Property that represents attributes mapped on numeric typesPathProperty<E>Property that represents path segment (relationship or embeddable).Property<E>Base interface for all types of propertiesFactory class that produces all property types.Interface (or "Trait") that provides basic functionality for all types of relationships.SetProperty<V extends Persistent>Property that represents to-many relationship mapped onSet
.StringProperty<E extends CharSequence>Property that represents attributes mapped on string types