Hi-
I have three tables, "User", "Role", "Service". User has an m:n
relationship with Role, and Role has an m:n relationship with Service.
Each user is a member of a role, and a role can access certain
services.
My problem is that I want to create a single query which returns
all the services a user can access. Is there any way to do this
in castor? I know how to get a collection of Roles from the User,
and Services from each of those Roles, but that results in a lot of
queries.
My initial guess (without having too much OQL experience) would be:
SELECT service FROM Service service, Role role, User user WHERE
user.login=$1 AND user IN role.userlist AND service IN role.servicelist
... but that doesn't work. Can I do what I'm trying to do in Castor?
Thanks,
-Mike
--
Mike Bridge
<[EMAIL PROTECTED]>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev