- Type Parameters:
T- entity class of the static metamodel.
- All Superinterfaces:
Attribute<T>
- All Known Subinterfaces:
BooleanAttribute<T>,ComparableAttribute<T,,V> NumericAttribute<T,,N> TemporalAttribute<T,,V> TextAttribute<T>
- All Known Implementing Classes:
SortableAttributeRecord,TextAttributeRecord
Represents a entity attribute in the StaticMetamodel
that is sortable, but incapable of order-based comparison.
A SortableAttribute may be used to sort query results.
When an attribute type is a numeric type, NumericAttribute is
preferred. When an attribute type is String, TextAttribute is
preferred. When an attribute type is boolean or Boolean,
BooleanAttribute is preferred. When an attribute type is a temporal
type supported by TemporalAttribute, TemporalAttribute is
preferred. When an attribute type (or, if primitive, its wrapper class) is a
subtype of Comparable, use of ComparableAttribute
is usually preferred, since a SortableAttribute cannot be used in
order-based query restrictions. Direct use of SortableAttribute is
appropriate for attributes of type byte[].
-
Method Summary
Modifier and TypeMethodDescriptionasc()Obtain a request for an ascendingSortbased on the entity attribute.desc()Obtain a request for a descendingSortbased on the entity attribute.static <T,V> SortableAttribute <T> Creates a static metamodelSortableAttributerepresenting the entity attribute with the specified name.Methods inherited from interface jakarta.data.metamodel.Attribute
declaringType, name, type
-
Method Details
-
asc
Obtain a request for an ascendingSortbased on the entity attribute.- Returns:
- a request for an ascending sort on the entity attribute.
-
desc
Obtain a request for a descendingSortbased on the entity attribute.- Returns:
- a request for a descending sort on the entity attribute.
-
of
Creates a static metamodel
SortableAttributerepresenting the entity attribute with the specified name.- Type Parameters:
T- entity class of the static metamodel.V- type of entity attribute (or wrapper type if primitive).- Parameters:
entityClass- the entity class.name- the name of the entity attribute.attributeType- type of the entity attribute.- Returns:
- instance of
SortableAttribute. - Since:
- 1.1
-