Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

criteria Find method

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 guess I've been abducted by space aliens. So unprofessional. They tried to probe me with this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic