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 | 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
|
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
.sqrt()
).
StringProperty
for all data types inherited from CharSequence
.like()
,
concat()
, etc.)
DateProperty
for Date
(and java.sql
variants)
and LocalDate
, LocalTime
, LocalDateTime
.year()
.
EntityProperty
for to-one relationships.dot()
methods, etc.
ListProperty
, SetProperty
and MapProperty
are for to-many relationships.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).
Copyright © 2001–2020 Apache Cayenne. All rights reserved.