我正在尝试在 Play 框架中构建查询,我有
select * from Candidate c where (:schools member of c.schools)
在我将 :school 与 List 与一个元素绑定后,它会返回结果,但如果我将 List 与多个元素绑定,则不会发生任何事情。
Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: {vector} [select c from models.Candidate c where (:schools0_, :schools1_ member of c.schools) group by c.id order by RAND()]
其实我需要类似的东西
select * from candidate where schools in (x,x,x,x,x);
候选人和学校之间的关系在链接表中。
有没有办法绑定多个值?