2012-02-10 52 views
-1

條款我想打一個這樣的查詢HQL在上表

createQuery("FROM Grouping g WHERE :user IN g.groupMembers OR :userId=g.groupAdminId") 

但休眠其轉換爲

snuser2_.id and ('12' in (.) or '12'=grouping0_.groupAdminId) 

g.groupMembers是一個List(@ManyToMany),我該如何使用IN運營商?

回答

1
from Grouping g where :user member of g.groupMembers or g.groupAdminId = :userId