Module jakarta.data

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:

Where possible, NumericAttribute, which provides more function, is preferred over ComparableAttribute and SortableAttribute.

Since:
1.1
  • 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 NumericAttribute representing 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.