有没有办法用 JPA 2 编写与CriteriaBuilder
以下查询等效的内容?
select * from season s1
where end = (
select max(end)
from season s2
where s1.contest_id=s2.contest_id
);
在 JPQL 中,这个查询是:
Select s1 from Season s1
where s1.end = (
select max(s2.end)
from Season s2
where s1.contest=s2.contest
)