thank you for the answers, the sql query Eric doesn't seem to be liked by mysql as it tells me there is an error.
What I really want to do is to get all the id's of all the users that have no roles and hence, I would not really have to use the security service as Henning kindly explained.
I just want to use a torque-like query with joins on a Criteria Objects and so forth, but I just do not know how to do it :-(
Ok. I believe MySQL doesn't like it because MySQL doesn't support sub queries (nested queries).
Try this.
Criteria crit = new Criteria();
crit.addSelectColumn(TurbineUserGroupRolePeer.USER_ID);
crit.setDistinct();
List distinctList = TurbineUserGroupRolePeer.doSelect(crit);
List userIds = new ArrayList();
Iterator it = distinctList.iterator();
while (it.hasNext())
{
userIds.add(
new Integer(
((TurbineUserGroupRole) it.next()).getUserId()));
}
crit = new Criteria();
crit.add(TurbineUserPeer.USER_ID, userIds, Criteria.NOT_IN);
List userNoGroupRole = TurbineUserPeer.doSelect(crit);Let me know your results.
Eric
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
