• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

URLyBird 1.1.3 find() interface method

 
Ranch Hand
Posts: 221
Scala Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Scala Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Scala Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic