aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes A question about  criteriaFind metod Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "A question about  criteriaFind metod" Watch "A question about  criteriaFind metod" New topic
Author

A question about criteriaFind metod

Sam Stackly
Ranch Hand

Joined: May 04, 2002
Posts: 109
Hi Guys,
In my instruction, the paramater for criteriaFind is a string which should contain Carrier and Origin, for example "Carrier='SpeedyAir',Origin='SFO'" ,now question is :Can I add Destination Flied ( that makes more sense to book a flight) in my string ??
Thanks
Charles Miller
Greenhorn

Joined: Jun 28, 2002
Posts: 19
I allow filtering on any combination of the field names. My filter dialog gets a list of the valid field names and creates a dialog (grid) with the names of the fields on the left and an entry field on the right. On exit, a collection is created that has the field names as keys and the filtering criteria as the value (only fields with data entered are included). A helper method converts the collection to a string and passes that to the criteriaFind() method.
Mike Piotrowski
Ranch Hand

Joined: Apr 24, 2002
Posts: 82
Sam,
My criteriaFind method was a generic search method. It takes any combination of name=value pairs, not just specific to FBN. This way it can be used for any database that the Data class can read. In my GUI, I enabled the user to search by either Destination, Origin or Carrier.
Mike
Sam Stackly
Ranch Hand

Joined: May 04, 2002
Posts: 109
Thanks Guys for reply ,
Creating a generic method like Mike mentioned is the point I was looking for. Thanks again.
Sam
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: A question about criteriaFind metod