Here is my mapping:
Code:
<hibernate-mapping>
<class name="security.User"
table="ice_user">
<id name="name" column="userName" type="string" length="64">
<generator class="assigned"/>
</id>
<set name="roles" table="ice_user_roles">
<key column="userName"/>
<element column="roleName" type="string" length="64" not-null="true"/>
</set>
</class>
</hibernate-mapping>
My question is this:
Will I EVER be able to make this query work in mysql
Code:
select user from security.User as user inner join user.roles as role where role = ?
I'm using inner join cause I've seen similar queries in the docs. I've had nothing but issues with this, I don't even know if the HQL is correct. Here is the exception I'm getting:
Code:
net.sf.hibernate.QueryException: collection of values in from clause: user0_.roles.elements [
select user from security.User as user inner join user.roles as role where role = ?
I had something last night(the debug log printed what looked like valid sql) using elements in the from? clause, but mysql does not support subqueries. Essentially all I want to do is select all the users that contain a particular role in their roles set. This is just a set of strings, not really entities. Thanks in advance.
--m