You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Weaver, Scott" <Sw...@rippe.com> on 2002/01/22 17:27:54 UTC

Advanced criteria question

The code below returns most Permissions not associated with the specified
Role.  However, it does not work fully.  If there is a Permission that is
not associated with any Role, i.e. it's not listed in
turbine_role_permission at all, it is not returned.  

Now the question: "What do I need to add to the criteria to make it pick up
ALL permissions NOT associated with the specified Role?"

String roleName = "some_role";

Criteria c= new Criteria();

c.addJoin(RolePeer.ROLE_ID,RolePermissionPeer.ROLE_ID);
c.addJoin(RolePermissionPeer.PERMISSION_ID, PermissionPeer.PERMISSION_ID);
c.add(RolePeer.NAME,(Object)roleName, Criteria.NOT_EQUAL);

Thanks,
Scott


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>