-->
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.  [ 3 posts ] 
Author Message
 Post subject: Filter associated set
PostPosted: Fri Jun 03, 2005 4:27 am 
Newbie

Joined: Fri Jun 03, 2005 4:08 am
Posts: 12
Hi,

I have a many-to-many association between 2 objects in which they are linked by a link table.

My question is how do I filter the set of associated object B objects based on some criteria?

In SQL terms, I need to have the associated set filtered like this:

Select * from table_B, link_table where table_B.id = link_table.id1 AND link_table.id1 = ${someValue} AND tableB.type='SomeFilter'

Right now my set is unfiltered and ends up retrieving all associated objects...

Of course I can cheat and do some filtering in the getter but that's hardly the elegant solution im looking for.

Thanks,
-Yves-


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 12:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
There are many ways to do this:

* Hibernate3 filter
* collection filter
* query

Read the documentation.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 9:13 pm 
Newbie

Joined: Fri Jun 03, 2005 4:08 am
Posts: 12
Yes I read about filters yesterday but the problem is I'm using XDoclet 1.2 which does not support filters yet, unlike XDoclet2.

Basically I was just looking for a solution which allows me to get those filtered values without having to write a query as much as possible.

Thanks!


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

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.