サブクエリで注文するhqlクエリを書くことは可能ですか? 次のようなクエリがあります。
select a from A.a join a.b where a.b.id = :id
私が必要とするのは次のようなものです:
select a from A.a join a.b where a.b.id = :id order by (select count(c) from C c where c.a = a.id) desc
サブクエリで注文するhqlクエリを書くことは可能ですか? 次のようなクエリがあります。
select a from A.a join a.b where a.b.id = :id
私が必要とするのは次のようなものです:
select a from A.a join a.b where a.b.id = :id order by (select count(c) from C c where c.a = a.id) desc