I have read several postings here in this forum where clearly there is a need to distinguish between the records matching
the criteria String in the find() interface method and in the GUI where:
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.
I just want to double check and clarify my assumptions with the find() interface method.
Is it correct to assume if we have the argument:
to my find() method in my Data class implementing the DB interface, should it return an int of record numbers where each record
will have "Sheraton" as Hotel name and "New York" as the Hotel Location and "4" as the maximum occupancy of the room?
Or should it return instead an int of record numbers where you have all the "Sheraton" hotel rooms, all the "New York" hotel rooms and all the rooms with "4" as the maximum occupancy?
On this forum are many, many threads containing discussions about the find-method and how the criteria should be used.
I OR'ed the different criteria (so in your example: return an int of recNo where you have all the "Sheraton" hotel rooms, all the "New York" hotel rooms and all the rooms with "4" as the maximum occupancy). So if 1 criterium matched, the recNo was added to the array that is returned.
In my business service the records returned by the find method are filtered, so only exact matches (which are AND'ed) will be shown in the GUI.
But as I said this is my approach, other people have AND'ed the different criteria in the find-method.
Almost al the threads you'll find about the find-method are dealing with AND'ing or OR'ing the different values of the criteria-array. The find-method returns records which "starts with" the according value, but your GUI is expecting exact matches.