-->
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.  [ 2 posts ] 
Author Message
 Post subject: use multiple filters at class level
PostPosted: Sun Dec 13, 2009 4:16 pm 
Newbie

Joined: Sun Dec 13, 2009 4:14 pm
Posts: 10
Problem1:
I have one filter already defined at the class level and wanted to have another filter at classs level. How to implement that?

Problem2:
My class structure is ClassA, ClassB and ClassC.

Class A contains set for Class B. They have one to many relationship.

ClassB and ClassC has many-to-one relationship. So I have following method call in my ClassB.
public ClassC getClassC(){//return instance of ClassC};

My initial filter in ClassA filters isactive='Y' column of Class B and works fine. This filter defined on the set collection of ClassB in Class A.

Now I have to define another filter at ClassA which filters
ClassB.ClassC.cityId =5 and it also need to implement at set collection of ClassB in ClassA.

How to do that?


Top
 Profile  
 
 Post subject: Re: use multiple filters at class level
PostPosted: Sun Dec 13, 2009 6:39 pm 
Newbie

Joined: Sun Dec 13, 2009 4:14 pm
Posts: 10
Now I have just tried to implement single filter on a collection of ClassB at ClassA.

Where my condition is CITY_ID=:cityId where CITY_ID is a foreign key of ClassC. But I am not getting expected result.
Looks like filter is not working.

So what I am doing is
Class C has a many to one relationship with ClassB.
Class B is a collection on ClassA.

I am putting above mentioned filter condition in ClassA.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.