将 HQL 查询转换为 criteria api
我想知道是否可以将此 HQL 查询转换为标准 api 查询。
select s1
from Student
where
(
select max(s2.Score)
from Student
where s1.Id = s2.Id
)
= 10
(选择最高分数等于 10 的学生)
由于“s1.Id = s2.Is”条件,我不知道是否可以使用独立标准
感谢任何可以帮助我的人
I'm wondering if is possible to convert this HQL query into a criteria api query.
select s1
from Student
where
(
select max(s2.Score)
from Student
where s1.Id = s2.Id
)
= 10
(selects the students that have their max score value equal to 10)
I don't know if I could use a detached criteria because of the 's1.Id = s2.Is' condition
Thanx for anyone who can help me
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
她去了,
但我不确定原始查询是否正确,因为如果 Id 是主键,子查询应该始终返回 1 行
her goes
but i'm not sure if the original query is correct because the subquery should always return 1 row if Id is the primary key