I'm new to Querydsl, I'm working on Spring data and Querydsl to make a dynamic filter, I use the interface: QueryDslPredicateExecutor so I can filter data using different entity fields, now I want to add "order by" to my query based on a BooleanExpression.
This my code:
QPersonData _personInventory = QPersonData.personData;
BooleanBuilder query = new BooleanBuilder();
query.and(_personInventory.status.eq(status));
Then I called my respository interface using the query:
personInventoryRepository.findAll(query, pageable);
My question is how I can apply "order by" to my query object based on different fields on my entity?