public class JpaSortBuilder<T> extends Object
JpaSortBuilder
class is used to convert and Ambari
SortRequest
and list of SortRequestProperty
into a JPA
Order
list. This can then be given to a CriteriaBuilder
to
provide sorting in the JPA layer during a query.
This classes uses the JpaPredicateVisitor
for the entity being
queried in order to convert the entity fields into Path
expressions.Constructor and Description |
---|
JpaSortBuilder()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
List<javax.persistence.criteria.Order> |
buildSortOrders(SortRequest sortRequest,
JpaPredicateVisitor<T> visitor)
Builds the list of sort orders based on the supplied request and JPA
predicate visitor.
|
public List<javax.persistence.criteria.Order> buildSortOrders(SortRequest sortRequest, JpaPredicateVisitor<T> visitor)
sortRequest
- the Ambari sort request properties to turn into a JPA sort
request. If null
or the SortRequestProperty
list
is null, an empty list is returned.visitor
- a visitor that knows how to convert the Ambari properties into
SingularAttribute
(not null
).null
).Copyright © 2022 Apache Software Foundation. All rights reserved.