This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Clarification on findByCriteria interface documentation (B&S ) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Clarification on findByCriteria interface documentation (B&S )" Watch "Clarification on findByCriteria interface documentation (B&S )" New topic
Author

Clarification on findByCriteria interface documentation (B&S )

b weiss
Greenhorn

Joined: Apr 14, 2009
Posts: 7


I was wondering if I could get some clarification about what this exactly means. I get that the method is supposed to return an array of which record numbers contain the information the user searched by. However:
Field n in the database file is described by criteria[n]


does this mean that the "column" the search is supposed to go through is the last element in the array?

Such that:
A null value in criteria[n] matches any field value.
means that there's no specific "column" to search through and everything should be searched.

and:
A non-null value in criteria[n] matches any field value that begins with criteria[n]
means that if criteria[n] == Name and a String in the criteria array happens to be "Fred" then any Strings in the Name "column" that contain "Fred" are valid records to return.


I have already finished my findByCriteria method and it works up to what I think the this documentation says but I just wanted to know if my train of thought for it was correct.

Thanks!




K. Tsang
Ranch Hand

Joined: Sep 13, 2007
Posts: 1219

You may want to check this thread about searching for URLyBird, but the idea is the same.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Clarification on findByCriteria interface documentation (B&S )
 
Similar Threads
[NX] Question about the findByCriteria.
NX: findByCriteria Method
Searching
NX: (Contractors) Regex vs. String.startsWith
URLyBird findByCriteria