Hi,
It seems simple but I'm not able to build a query that properly describes the following case:
- The class UserGroup has a list of users (UG.users) - The class C has a list of users (C.users) - The class C has a list of UserGroup (C.usersgroups)
My goal is to build a query that returns all classes "C" that contain a specific user through the lists "C.users" or "C.usersgroups.users". I am trying it by using the following JPQL query.
SELECT C FROM table_x C, IN(C.users) U1, IN(C.usersgroups) UG, IN(UG.users) U2 WHERE (U1 = :iduser) OR (U2 = :iduser)
This is not returning any row when it is supposed to return one row.
Any ideas?
Best Regards,
Anthony
|