I’m rewording (hopefully simplifying) my previous question as it got no response.
When a Parent Entity contains a List property, how can I control/configure/override the default Parent database query such that it always returns its List property in a required sort order?
So:
Parent p has List children property (One-Many).
So when I fetch p from the database, I want its List children returned in a sorted order.
@OrderBy annotation on List property won’t work because the sort I need to implement is on a nested Child property and its dot notation only works with @Embeddable types.
Of course I can sort application side with Comparable/Comparator but I’d prefer to understand if I can actually configure this via JPA/Query.
Thanks. Hope someone can help.