Do you believe that will be useful to have filters in the many-to-one associations?
we need something like that and for that we did this
<many-to-one
name="description"
column="description_id"
class="Description"
fetch="join"
>
</many-to-one>
<filter name="language" condition="'ES' = descriptio2_.language_id"/>
the "descriptio2_." is the alias that hibernate create for the description class.
select .. from Global_Data_Definitions this_ inner join Descriptions descriptio2_ on this_.description_id=descriptio2_.description_id where and 'ES' = descriptio2_.language_id
it work, but not 100%
because the filter is not added at the join, like this.
select .. from Global_Data_Definitions this_ inner join Descriptions descriptio2_ on this_.description_id=descriptio2_.description_id
and 'ES' = descriptio2_.language_id
comments?
|