Class JakartaDataRestriction
java.lang.Object
org.hibernate.query.restriction.JakartaDataRestriction
Converts Jakarta Data
restrictions to Hibernate query restrictions or
directly applies them to JPA criteria queries, and
Jakarta Data constraints to
JPA predicates. The
operations of this class act as a bridge between the Jakarta Data APIs and
the native restriction API, which is itself a facade over the JPA Criteria
API.
- Since:
- 8.0
- API Note:
- This class is not intended for direct use by application programs. It is called by Jakarta Data repository implementations generated by Hibernate Data Repositories.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Restriction<T> adaptRestriction(jakarta.data.restrict.Restriction<? super T> restriction) Adapt the given Jakarta Data restriction.static <T> PredicateapplyConstraint(Expression<? extends T> expression, jakarta.data.constraint.Constraint<T> constraint, Root<?> root, CriteriaBuilder builder) Apply the given Jakarta Data constraint to the given JPA expression, returning a JPA criteria predicate.static voidapplyOrder(Order<?> order, CriteriaQuery<?> query, Root<?> root, CriteriaBuilder builder) Apply the given Jakarta Data order to the given root entity of the given criteria query.static <T> voidapplyRestriction(jakarta.data.restrict.Restriction<? super T> restriction, CriteriaQuery<?> query, Root<? extends T> root, CriteriaBuilder builder) Apply the given Jakarta Data restriction to the given root entity of the given criteria query.static voidapplySort(Sort<?> sort, CriteriaQuery<?> query, Root<?> root, CriteriaBuilder builder) Apply the given Jakarta Data sort to the given root entity of the given criteria query.
-
Method Details
-
adaptRestriction
@Nonnull public static <T> Restriction<T> adaptRestriction(@Nonnull jakarta.data.restrict.Restriction<? super T> restriction) Adapt the given Jakarta Data restriction. -
applyRestriction
public static <T> void applyRestriction(@Nonnull jakarta.data.restrict.Restriction<? super T> restriction, @Nonnull CriteriaQuery<?> query, @Nonnull Root<? extends T> root, @Nonnull CriteriaBuilder builder) Apply the given Jakarta Data restriction to the given root entity of the given criteria query. -
applyOrder
public static void applyOrder(@Nonnull Order<?> order, @Nonnull CriteriaQuery<?> query, @Nonnull Root<?> root, @Nonnull CriteriaBuilder builder) Apply the given Jakarta Data order to the given root entity of the given criteria query. -
applySort
public static void applySort(@Nonnull Sort<?> sort, @Nonnull CriteriaQuery<?> query, @Nonnull Root<?> root, @Nonnull CriteriaBuilder builder) Apply the given Jakarta Data sort to the given root entity of the given criteria query. -
applyConstraint
@Nonnull public static <T> Predicate applyConstraint(@Nonnull Expression<? extends T> expression, @Nonnull jakarta.data.constraint.Constraint<T> constraint, @Nonnull Root<?> root, @Nonnull CriteriaBuilder builder) Apply the given Jakarta Data constraint to the given JPA expression, returning a JPA criteria predicate.
-