I want to use JPA 2.0 api criteria to create an order by clause with a subquery. I know that you can do this in plain SQL, but can it be matched against api criteria? Can someone please provide an example code?
Example:
Order(name, address) // table1 OrderPriority(address, priority) // table2 priority by address select o from Order o order by (select p.priority from OrderPriority p where p.address = o.address)
source share