Hibernate 左连接使用 with
阅读 hibernate 文档,您会发现有关左连接的以下内容 在这里。
from Cat as cat
left join cat.kittens as kitten
with kitten.bodyWeight > 10.0
假设以下设置。
Cat1
Kitten1 (bodyWeight:11.0)
Kitten2 (bodyWeight:12,5)
Cat2
Kitten3 (bodyWeight:17.1)
Kitten4 (bodyWeight:5,2)
Cat3
给定设置后,上面的查询会给我们以下结果吗?
Cat1
Kitten1 (bodyWeight:11.0)
Kitten2 (bodyWeight:12,5)
Cat2
Kitten3 (bodyWeight:17.1)
...
Cat3
Reading the hibernate documentation, you find the following on Left Joins here.
from Cat as cat
left join cat.kittens as kitten
with kitten.bodyWeight > 10.0
Assume the following setup.
Cat1
Kitten1 (bodyWeight:11.0)
Kitten2 (bodyWeight:12,5)
Cat2
Kitten3 (bodyWeight:17.1)
Kitten4 (bodyWeight:5,2)
Cat3
Given the setup, will the query above give us the following result?
Cat1
Kitten1 (bodyWeight:11.0)
Kitten2 (bodyWeight:12,5)
Cat2
Kitten3 (bodyWeight:17.1)
...
Cat3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,如果有另一只猫
Cat4 也会被退回,但没有小猫
yes and if there was another cat
Cat4 would also be returned, but with no kittens