Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: URLYBird - Use of findByCriteria(String [ ])?

 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Actually I posted this in a different thread, but thought it is not relevant to that and so starting as the new thread(Am gonna delete it there).
I am having difficulty in understanding the reason for the existence of findByCriteria() method.
Instructions given by the Sun are as follows. It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user. This is the instruction in "The User Interface" section.
As there is "or" in the requirement, we can just provide search for the name/location fields and not all the fields. Here they have mentioned strictly by specifying "must" and so we must exactly match like George and others said, case sensitive too.
And again, the findByCriteria() is given by
// Returns an array of record numbers that match the specified
// criteria. Field n in the database file is described by
// criteria[n]. A null value in criteria[n] matches any field
// value. A non-null value in criteria[n] matches any field
// value that begins with criteria[n]. (For example, "Fred"
// matches "Fred" or "Freddy".)
public long[] findByCriteria(String[] criteria);
Is this the function we are supposed to implement to get the search results for the requiement mentioned in "The User Interface" section? If so, there is some deviation right? I mean, this function should return like say for Fred, anything that starts with Fred like Fredo, Freddy.
Or are we supposed to implement the search requirement for the "The User Interface" section in a different funtion? If so, I do not see the need for findByCriteria() method. Please correct me if I'm wrong.
Appreciate your help, thanks.
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Satish,
About the apparent and/or and and exact/partial matches apparent contradictions in searching, I suggest you to read the two threads below (and possibly the links included):
http://www.coderanch.com/t/184550/java-developer-SCJD/certification/NX-Search-Criteria-GUI
http://www.coderanch.com/t/184754/java-developer-SCJD/certification/NX-findByCriteria
Don't hesitate though to go on asking questions in this thread is something looks still unclear after reading.
Regards,
Phil.
 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Phil. I have gone through the threads once, but could'nt understand them. I will go through them for a couple of more times (or more) and if I still have any doubts, I will post it there as it will be more appropriate there.
Appreciate your help. Thanks.
 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Phil, I got it now. Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic