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

URLyBird 1.1.3 find() interface method

 
Carlos Morillo
Ranch Hand
Posts: 221
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everybody,


I have in my assignment DB interface:





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?


Thanks in advance for your help,


Carlos.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Carlos,

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.

Kind regards,
Roel
 
Carlos Morillo
Ranch Hand
Posts: 221
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roel,


I've been doing a lot of search lately here and I did find only the distinction between the find() interface method and what should be done in the GUI
that are 2 totally separate things.

For the latter I did see a lot about AND and OR, but not much about the find() interface method itself.


Thanks,


Carlos.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's exactly the problem you are facing

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.

Kind regards,
Roel
 
Carlos Morillo
Ranch Hand
Posts: 221
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roel,

At the moment I am good and my find() method is already implemented.
You have already been very helpful.


Best Regards,

Carlos.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic