These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Include Filters in the many-to-one
PostPosted: Tue Jul 19, 2005 3:21 pm 
Newbie

Joined: Thu Mar 24, 2005 12:42 pm
Posts: 2
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.