Hello,
I wasn't able to find a good keyword for the search tool to help me on this issue.
My DB contains a user list, user groups (thus containing users), activities (linked to a user group), and a potential relation between users and activities.
Now, I want to select the list of all users concerned by an activity, with the properties coming this potential relation.
Thus I would use a left outer join, if doing it with plain old SQL:
Code:
select .... FROM activity
... // different joins to link usergroup, user_usergroup and user tables
inner join user_activity ua on user.id = ua.id_user and activity.id = ua.id_activity
WHERE activity.id = 15
Now, I'm trying to use (N)Hibernate to do the job, and I found Criteria API very interesting. But I can't find a way to
generate this SQL query with multiple join fields:
" inner join user_activity ua on user.id = ua.id_user
and activity.id = ua.id_activity "
The best solution I could create was with this link in the WHERE statement, and so broke the left outer join effect...
Do you know if it is possible with Criteria API ? Or Should I stick with SQL/HQL ?
Regards