Module jakarta.data
Package jakarta.data.metamodel
Interface NumericAttribute<T,N extends Number & Comparable<N>>
- Type Parameters:
T- entity class of the static metamodel.N- type of entity attribute (or wrapper type if primitive).
- All Superinterfaces:
Attribute<T>,BasicAttribute<T,,N> ComparableAttribute<T,,N> ComparableExpression<T,,N> Expression<T,,N> NumericExpression<T,,N> SortableAttribute<T>
public interface NumericAttribute<T,N extends Number & Comparable<N>>
extends ComparableAttribute<T,N>, NumericExpression<T,N>
Represents a numeric entity attribute in the
StaticMetamodel.
Numeric entity attributes can be sorted on in query results and can be
compared against values in query restrictions. They can also be used as and
within numeric expressions involving various arithmetic operations.
Entity attribute types that are considered numeric include:
- numeric primitve types:
byte,double,float,int,long,short - numeric wrapper types:
Byte,Double,Float,Integer,Long,Short BigDecimalandBigInteger
Where possible, NumericAttribute, which provides more function,
is preferred over ComparableAttribute and SortableAttribute.
- Since:
- 1.1
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <T,N extends Number & Comparable<N>>
NumericAttribute<T, N> Creates a static metamodelNumericAttributerepresenting the entity attribute with the specified name.Methods inherited from interface jakarta.data.metamodel.Attribute
attributeType, declaringType, nameMethods inherited from interface jakarta.data.expression.ComparableExpression
between, between, greaterThan, greaterThan, greaterThanEqual, greaterThanEqual, lessThan, lessThan, lessThanEqual, lessThanEqual, notBetween, notBetweenMethods inherited from interface jakarta.data.expression.Expression
equalTo, equalTo, in, in, in, isNull, notEqualTo, notEqualTo, notIn, notIn, notIn, notNull, satisfiesMethods inherited from interface jakarta.data.expression.NumericExpression
abs, asBigDecimal, asBigInteger, asDouble, asLong, divide, divide, dividedInto, minus, minus, negated, plus, plus, subtractedFrom, times, timesMethods inherited from interface jakarta.data.metamodel.SortableAttribute
asc, desc
-
Method Details
-
of
static <T,N extends Number & Comparable<N>> NumericAttribute<T,N> of(Class<T> entityClass, String name, Class<N> attributeType) Creates a static metamodel
NumericAttributerepresenting the entity attribute with the specified name.- Type Parameters:
T- entity class of the static metamodel.N- 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
NumericAttribute.
-