Answer the question
In order to leave comments, you need to log in
Is it possible to create a Pageable to sort by nested property?
I have a Cat entity that contains a Kitty entity . Kitty in turn contains a name field .
Now I want to create a Pageable to sort the cats. And I want to sort them by the name of their kittens.
Would a Pageable like this work:
PageRequest.of(pageNum, pageSize, direction, "kitty.name");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question