Module jakarta.data
Package jakarta.data.metamodel
package jakarta.data.metamodel
A static metamodel for entities that are used in Jakarta Data repositories.
The StaticMetamodel
allows for type-safe operations that avoid the
need to hard-code entity attribute names as Strings. For example,
@Entity public class Product { @Id public long id; public String name; public float price; } @StaticMetamodel(Product.class) public class _Product { public static volatileSortableAttribute<Product>
id; public static volatileTextAttribute<Product>
name; public static volatileSortableAttribute<Product>
price); } ... @Repository Products products; ...Pagerequest<Product>
pageRequest = Order.by(_Product.price.desc(), _Product.name.asc(), _Product.id.asc()) .page(1) .size(20); page1 = products.findByNameLike(namePattern, pageRequest);
The module Javadoc provides an overview
of Jakarta Data.
-
ClassDescriptionAttribute<T>Represents an entity attribute in the
StaticMetamodel
.Represents a sortable entity attribute in theStaticMetamodel
.Annotates a class which serves as a static metamodel for an entity, enabling type-safe access to entity attribute names and related objects such as instances ofSort
s for an attribute.Represents an textual entity attribute in theStaticMetamodel
.