Hi Steve,
I have read on the 3.0.2 release note that the following improvement had been made:
Quote:
improved filtering of many-to-many associations
I am not sure if this means that the bug referenced in JIRA item
HHH-229 has been fixed. If this is the case, I am still having problems with filtering on many-to-many associations.
Here is my case:
I have a Group and a Role entity with a group_to_role association table.
Group has a many-to-many relationship to Role, on which I have added a filter. The filter checks that the attribute Role.domain_id is set to a certain value. The attribute domain_id is not present on the group_to_role association table.
By looking at the query being executed, I see that it discriminates based on domain_id on both Group and group_to_role tables, which thrown a SQL Exception:
Quote:
Invalid column name 'domain_id'.
Here is the mapping of the association that is not being filtered properly.
Code:
<set name="assignedRoles" table="security_group_to_role" lazy="true" cascade="save-update" access="field">
<key column="group_id"/>
<many-to-many class="SecurityRoleImpl" column="role_id"/>
<filter name="FilterSecurityObjectBasedOnDomainId" condition="domain_id=:domainId"/>
</set>
Thanks in advance for your help,