• 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

Bodgitt and Scarper : Find Method

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Got off to a good start on the Java Developers Bodgitt and Scarper, and indeed I've come up with a general find algorithm. But I have a few questions and I'm hoping that someone who did or doing this project can help.

1) There is an & (ampersand) used for the subcontractor name. I'm using equalsIgnoreCase to compare the criteria to the corresponding record but with the finished application I cannot imaging someone using & and instead saying "and". Should I just make some intelligence on this or is there a better way for comparing?

2)Should the find criteria work on finding the "customer holding this record" field?

Many thanks
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy, Kevin. In the name of the JavaRanch family, I'd like to give you a warm welcome!!!

For your first question, I'd say no. Since it is a name, I guess it would be better to just face '&' as '&'.

I'm not sure if I understood your second question. Do you mean, allowing the user to search also for customer ID?... Take a look at your instructions; in my case, I only had to provide full search and search by name and/or location. Most likely, you don't have to provide a search by customer ID.
 
Kevin Broderick
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Roberto - especially for giving me a warm welcome here on the java ranch.

I will again take a read of the instructions as you said here but I did have a feeling that I was over worrring about searching for the customer ID.

Thanks
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kevin,

In my B&S 2.2.1 instructions, in the "User Interface" section, it reads:

"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 took this to mean that name and location searching MUST be case-sensitive. I thought I'd warn you of this, in case your instructions are similar.

Also, I created a complete search capability for all criteria, not just for name and location. According to my B&S instructions the user interface is to be developed with the anticipation of future functionality improvements. So, at some later time if searching using more criteria is required, findByCriteria should already have that functionality, I think.

Best,

Grary
 
Roberto Perillo
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy, y'all.

Grary Stimon wrote:I took this to mean that name and location searching MUST be case-sensitive.



Well, not necessarily... some people chose to create a case-sensitive search... I myself created a non-case-sensitive search. As long as you justify your choice, that's a-ok.

I thought I'd warn you of this, in case your instructions are similar.

Grary Stimon wrote:According to my B&S instructions the user interface is to be developed with the anticipation of future functionality improvements. So, at some later time if searching using more criteria is required, findByCriteria should already have that functionality, I think.



Now, this one is a good choice! I also did that!
 
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 Kevin,

The find-method in my Data class is a case-insensitive search where the different criteria are OR'ed (so 1 match is enough, a null criterium is ignored) and a startsWith check is executed. You can search on all possible record values (hotel name, location, smoking, customer-id,...), but in my application only hotel name and location are used (for the other ones I did a selective test in my Data class test case).

If the name contains a &, - or ' for example, these symbols should be entered, no artificial intelligence added to translate for example 'and' into '&' (the assignment is difficult enough without it )

Kind regards,
Roel
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic