• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

public Collection findByGenre(String Genre) throws **FinderException**..

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
my 2nd question to the group
I read in HeadFirstEJB that finder methods that return Collections return an empty collection if nothing is found and do not throw a FinderException.
Why then on page 398 is the method

public Collection findByGenre(String Genre) throws FinderException, RemoteException;

declared as throwing as FinderException?

Thanks
Kenny
 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have searched in the spec and not able to find clear definition for this, but it is mentioned in both single entity finder as well multi entity finder. Also it is mentioned for the select methods...
 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are many reasons that would bring you errors in finding some entities in the database. So any find or select methods have to define finderException.

For example, your given primary key does not have a matching in the table, or you do not have authurization to retrieve that entity, or some other application exception occurs during find process, no matter what, the method will bring up the finderException, because after all, exception happens in the 'find' prcoess of the method.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Many thanks
Kenny
 
The glass is neither half full or half empty. It is too big. But this tiny ad is just right:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic