Joni Suominen wrote:
> 
> Eddie wrote:
> >
> > To me it's a bit unclear when I need to throw a FinderException in the
> > finder methods in the Home interface with CMP. ?
> > Now I only throw a finderException in case of
> > - the findByPrimareyKey (otherwise orion complaints),
> > - and in case of a single return object (orion doesn't complain, but gives
> > "strange" runtime errors).
> >
> > So when a finder returns a collection I don't throw a finderException!! Is
> > this correct ?
> 
> No. Every finder method should declare that it throws FinderException.
> 
> Joni
> [EMAIL PROTECTED]

To be more specific:
In the home interface you should declare all the fonder methods to throw
FinderException. But when a method which returns a non-collection raises
an exception it will be ObjectNotFoundException (which is a subclass of
FinderException). However, if a finder method which returns a collection
don't find any matching objects an empty collection is returned. The
method signature must still declare the FinderException in home
interface which seems to be a bit illogical?

Joni
[EMAIL PROTECTED]

Reply via email to