Hi all,
I have the following scenario:
- An entity A that has a OneToMany relationship to another entity Entity B.
- A repository that extends QueryDslPredicateExecutor<EntityA>, to have access to paging and sorting out of the box. It returns me instances of EntityA.
Page<T> findAll(Predicate var1, Pageable var2);
- I'm applying a Sort in a property/column of Entity B.
I'm struggling with the fact that it's returning me duplicates of EntityA, since the relation with B is OneToMany. I have researched and it seems to not be possible to distinct the result in the predicate.
Is there a way where I can achieve this, and still be able to take advantage of Paging and Sorting?
Many thanks.