我想像这样进行查询
createQuery("FROM Grouping g WHERE :user IN g.groupMembers OR :userId=g.groupAdminId")
但是hibernate将其转换为
snuser2_.id and ('12' in (.) or '12'=grouping0_.groupAdminId)
g.groupMembers是一个List(@ManyToMany),我该如何使用IN运算符?
答案 0 :(得分:1)
from Grouping g where :user member of g.groupMembers or g.groupAdminId = :userId