*
The moose likes Object Relational Mapping and the fly likes how to use multiple filters at class level Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "how to use multiple filters at class level" Watch "how to use multiple filters at class level" New topic
Author

how to use multiple filters at class level

Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

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?
Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

As a second thought, if I can use multiple ParamDef in same filter that will also work.
But in that case I don't know how to put condition on the object of ClassC(i.e. ClassB.ClassC.cityId=:cityId)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to use multiple filters at class level
 
Similar Threads
Parsing a variable
Java Polyphormismus BUG (solved: not a bug:-)
java classes
Scope and array questions
Subclass calls super class constructor then how many object will be created