是否可以通过某些子查询编写 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