| I've the same type of bug with a ManyToMany. A,B,C where B extends A and has a collection of C. Put the company filter on B, everything is fine. Put the company filter on A and the filter will be on the wrong join. The workaround was the put the filterdef/filter in all classes that extends A and it worked. Here's the result of the real case we have here if we put the filter on the parent class. The supplierrm2_1_ is declared in the next left join so that query will fail. left outer join SupplierRMA supplierrm2_ on itemtoship1_.id=supplierrm2_.supplierReturnMerchandise_id and supplierrm2_1_.company_id = ? left outer join Document supplierrm2_1_ on supplierrm2_.id=supplierrm2_1_.id That test was with hibernate 3.2 modified to support filters (from 3.6.x) so I assume that bug exist since the first version of the filter feature. |