【发布时间】:2014-12-05 10:36:28
【问题描述】:
在我的项目中,我发现了以下语法
createQuery("select stuInfo from StudentInfo stuInfo, IN(stuInfo.studentList) studentList "
+ "where stuInfo.completed =:completed and studentList.Date is null");
我尝试谷歌一下,IN关键字在where子句前有什么用,但我没有找到任何关于这个概念的解释。
【问题讨论】:
-
你有任何证据证明它是合法的 HQL 语法吗?
-
我无法为您提供任何证据,但我可以说这个查询在我过去 2 年的项目中有效,在调试期间我发现了这个。
-
那么
StudentInfo.studentList的类型是什么? -
检查它产生的sql
-
studentList 是另一个表,与 StudentInfo 映射为@OneToMany