That query seems like it should work if your users never have more than one 
role.  Unfortunately I don't know off the top of my head what the query should 
look like if users can have more than one role.

Nathan

----- Original Message -----
From: "Qin Ding" <[EMAIL PROTECTED]>
To: users@appfuse.dev.java.net
Sent: Tuesday, June 5, 2007 2:41:45 PM (GMT-0800) America/Los_Angeles
Subject: [appfuse-user] User/Role Query 

If I have users with different roles in the set, how can I query user
object to get a list of users with a particular role?

Role role = new Role("team lead");
getHibernateTemplate().find("from User u where u.roles = ? ", role);

Thanks.

QD
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to