You don't throw ObjectNotFoundException in this case: it's documentation
just included a red herring on the real issue.
>From the 1.1 spec, section 9.1.9.4:
"Only single-object finders (see Subsection 9.1.8) should throw this
exception. Multi-object finders must not throw this exception.
Multi-object finders should return an empty collection as an indication
that no matching objects were found."
On Fri, 16 Feb 2001, Tim Endres wrote:
> Maybe I do not understand the question, but if you are throwing an
> ObjectNotFoundException, isn't the returned value meaningless?
>
> tim.
>
> > I'm a bit confused what should be returned by finders that return
> > multiple objects. In the EJB 1.1 specs, it is stated an empty collection
> > should be returned. However, in the JavaDocs for
> > ObjectNotFoundException, it is stated a null collection should be
> > returned. My understanding is null collection is null, and an empty
> > collection is a collection with zero elements. So which should I return
> > (I prefer the empty collection approach, as it simplifies both the bean
> > and client implementations)?
> >
> > ===========================================================================
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> > of the message "signoff EJB-INTEREST". For general help, send email to
> > [EMAIL PROTECTED] and include in the body of the message "help".
> >
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
--
Dan Christopherson (danch)
nVisia Technical Architect (www.nvisia.com)
Opinions expressed are mine and do not neccessarily reflect any
position or opinion of nVISIA.
---------------------------------------------------------------------------
If you're a capitalist and you have the best goods and they're
free, you don't have to proselytize, you just have to wait.
-Eben Moglen
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".