I have a below HQL query
"select distinct p from Participant p left join fetch p.basketItemViewStates as bi where p.basket.id = ?1 order by p.lastName"
where Participant
has child list of BasketItemViewStates
and BasketItemViewStates further have a child with one to one relationship called
@OneToOne(cascade = CascadeType.MERGE)
private BasketItem basketItem;
BasketItem has sortOrder as a column
, i want that list which is fetched in join, should be sorted on the basis of that sortOrder.
Can anyone explain, how i can do it in above query