4
我想使用JPA 2.0條件api構建子查詢的順序子查詢。我知道你可以在普通的SQL中做到這一點,但它可以與標準API映射?有人可以給一個代碼示例嗎?JPA 2.0子查詢/子查詢按條件排序的條件api
實施例:
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)
歡迎來到stackoverflow! –