File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes criteria Find method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "criteria Find method" Watch "criteria Find method" New topic
Author

criteria Find method

poornima sudharshan
Greenhorn

Joined: May 18, 2001
Posts: 18
Can the String I pass to the criteria Find method be in this fashion -
"Origin airport = 'SFO', Destination airport = 'DEN'";
Why is there a neccessity to use Carrier since the user gets the option to choose only the Origin & Destination from the UI.
Also can I get the 'Origin airport' string & the 'destination airport' string from the database instead of hard coding it?
Please reply,
poornima.
Matt Cannata
Greenhorn

Joined: Mar 23, 2001
Posts: 23
The idea is to have the Data class be a usable database for different applications. For example, if I was making a clothing inventory system I'd want to be able to pass in something like "Color='Blue'". In order for the search to be successful, you have to be able to match the query columns with something that exists in the database schema (as defined in the FieldInfo[], description)
poornima sudharshan
Greenhorn

Joined: May 18, 2001
Posts: 18
Thanks for the reply Matt,
Can u please clear this for me -
If my task now is to match the String in the query column with the values in the database,
first I get the String in the Query column,then with what String do I concatenate this with?
The Query column might be a String representing Origin,or Destination or carrier,or anything else.
SMK Reddy
Greenhorn

Joined: Jun 03, 2001
Posts: 20
Hi Poornima
In your comment,
"If my task now is to match the String in the query column with the values in the database, first I get the String in the Query column, then with what String do I concatenate this with?"
Why are you concatenating?, did I missed what you are trying to say?
A criterion represents the matching criteria for single record. Your query string represents tokens of <Column name>=< 'value' >.
Parse these tokens to separate the column names and its value.
Next compare the column value with corresponding DB record column value.
A suggestion is, you can implement a method in the record (DataInfo) object to get the value of a column by passing the column name as an argument. This helps you to sort out the matching records easily.
May be this will help.
[This message has been edited by SMK Reddy (edited June 17, 2001).]
[This message has been edited by SMK Reddy (edited June 17, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: criteria Find method
 
Similar Threads
criteria format in criteriaFind method
Stupid Q but need help
search algorithm: clarity and efficiency
question about assignment
criteriaFind().. implementation