Hi,
I am still quite new to hibernate and have a problem I don't seem to be able to solve. I have a dynamic search page which builds up a criteria object. The basic query works fine, but now I have to restrict the amount of hits based on user access rights. Basically every user is in multiple access roles and the items I am looking for are also assigned to multiple access roles. My search will sofar retrieve all items based on the search criteria, but I have no clue on how to solve the problem with the access rights in the criteria api, since I don#t think it supports theta style joins. The user class has a List of access roles (n:m) and the items also have a List of access roles (n:m). Can you show me how to make sense of this issue? I guess there must be a way of using a subquery and an exist operator, but I seem not to be smart enough to solve this issue.
Kindest regards Dennis
|