Class ExpressionOrder
java.lang.Object
io.micronaut.data.model.Sort.Order
io.micronaut.data.model.jpa.criteria.impl.ExpressionOrder
A
Sort.Order that orders by an arbitrary expression rather than by an attribute name.
Only the criteria based query paths can honour it; they recognize this type and ask it for the
criteria expression to order by.- Since:
- 5.2
- Author:
- Denis Stepanov
-
Nested Class Summary
Nested classes/interfaces inherited from class Sort.Order
Sort.Order.Direction, Sort.Order.NullOrdering -
Constructor Summary
ConstructorsConstructorDescriptionExpressionOrder(String description, Sort.Order.Direction direction, boolean ignoreCase, Sort.Order.NullOrdering nullOrdering, BiFunction<jakarta.persistence.criteria.Root<?>, jakarta.persistence.criteria.CriteriaBuilder, jakarta.persistence.criteria.Expression<Object>> expressionFactory) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()jakarta.persistence.criteria.Expression<Object> toExpression(jakarta.persistence.criteria.Root<?> root, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) Builds the criteria expression to order by.Methods inherited from class Sort.Order
asc, asc, desc, desc, getDirection, getNullOrdering, getProperty, isAscending, isIgnoreCase, of, reverse, toString
-
Constructor Details
-
ExpressionOrder
public ExpressionOrder(String description, Sort.Order.Direction direction, boolean ignoreCase, Sort.Order.NullOrdering nullOrdering, BiFunction<jakarta.persistence.criteria.Root<?>, jakarta.persistence.criteria.CriteriaBuilder, jakarta.persistence.criteria.Expression<Object>> expressionFactory) Default constructor.- Parameters:
description- A human readable description of the expression, used as the order's property namedirection- The directionignoreCase- Whether to ignore casenullOrdering- Where to place null values relative to non-null valuesexpressionFactory- Builds the criteria expression to order by
-
-
Method Details
-
toExpression
public jakarta.persistence.criteria.Expression<Object> toExpression(jakarta.persistence.criteria.Root<?> root, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) Builds the criteria expression to order by.- Parameters:
root- The criteria rootcriteriaBuilder- The criteria builder- Returns:
- The expression to order by
-
equals
- Overrides:
equalsin classSort.Order
-
hashCode
public int hashCode()- Overrides:
hashCodein classSort.Order
-