Package jakarta.data.model
Class Attribute
java.lang.Object
jakarta.data.model.Attribute
Represents an entity attribute in the
StaticMetamodel.-
Method Summary
Modifier and TypeMethodDescriptionfinal Sortasc()Obtain a request for an ascendingSortbased on the entity attribute.final SortObtain a request for an ascending, case insensitiveSortbased on the entity attribute.final Sortdesc()Obtain a request for a descendingSortbased on the entity attribute.final SortObtain a request for a descending, case insensitiveSortbased on the entity attribute.static final Attributeget()Obtains a new instance for the Jakarta Data provider to initialize.final booleaninit(AttributeInfo attrInfo) Used by the Jakarta Data provider to initialize thisAttributewith implementation.final Stringname()Obtain the entity attribute name, suitable for use wherever the specification requires an entity attribute name.
-
Method Details
-
asc
Obtain a request for an ascendingSortbased on the entity attribute.- Returns:
- a request for an ascending sort on the entity attribute.
- Throws:
MappingException- if an entity attribute with this name does not exist or if no Jakarta Data provider provides a repository for the entity type.
-
ascIgnoreCase
Obtain a request for an ascending, case insensitiveSortbased on the entity attribute.- Returns:
- a request for an ascending, case insensitive sort on the entity attribute.
- Throws:
MappingException- if an entity attribute with this name does not exist or if no Jakarta Data provider provides a repository for the entity type.
-
desc
Obtain a request for a descendingSortbased on the entity attribute.- Returns:
- a request for a descending sort on the entity attribute.
- Throws:
MappingException- if an entity attribute with this name does not exist or if no Jakarta Data provider provides a repository for the entity type.
-
descIgnoreCase
Obtain a request for a descending, case insensitiveSortbased on the entity attribute.- Returns:
- a request for a descending, case insensitive sort on the entity attribute.
- Throws:
MappingException- if an entity attribute with this name does not exist or if no Jakarta Data provider provides a repository for the entity type.
-
get
Obtains a new instance for the Jakarta Data provider to initialize.
The Jakarta Data provider automatically initializes the instance when used as the value of a
public,static,finalfield of a class that is annotated withStaticMetamodel, where the field name matches the name of an entity attribute. For example, aVehicleentity with attributesvin,make,model, andyearcould have the following static metamodel,@StaticMetamodel(Vehicle.class) public class Vehicle_ { public static final Attribute vin = Attribute.get(); public static final Attribute make = Attribute.get(); public static final Attribute model = Attribute.get(); public static final Attribute year = Attribute.get(); }- Returns:
- a new instance for an entity attribute.
-
init
Used by the Jakarta Data provider to initialize thisAttributewith implementation.- Parameters:
attrInfo- attribute information provided by the Jakarta Data provider.- Returns:
- true if initialization was successful; false if previously initialized.
-
name
Obtain the entity attribute name, suitable for use wherever the specification requires an entity attribute name. For example, as the parameter toSort.asc(String).- Returns:
- the entity attribute name.
- Throws:
MappingException- if an entity attribute with this name does not exist or if no Jakarta Data provider provides a repository for the entity type.
-