I understand your point and I completely agree that it's illogical. That's
why I started testing around and found out that it's not necessary to throw
a finderexception in case of a "return collection".
Like I see it now: I finderException is never thrown in case of a collection
as it always returns an empty collection when it can't find anything ? Or am
I missing something here.

Neither does Orion complain when you leave out the FinderException!
Or are there other situations when a FinderExceptions can occur in case of a
Collection ??

Eddie

----- Original Message -----
From: Joni Suominen <[EMAIL PROTECTED]>
To: Orion-Interest <[EMAIL PROTECTED]>
Sent: Monday, May 21, 2001 6:41 PM
Subject: Re: finderException in home interface of CMP ??


> 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