The "book" whichever book it is is 100% incorrect. You should return an
"empty" collection not a null one. See the EJB spec section 9.1.9.4
"Multi-object finders should return an empty collection as an indication
that no matching objects were found."
Dave Wolf
Internet Applications Division
Sybase
----- Original Message -----
From: "Dan Christopherson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 16, 2001 6:01 PM
Subject: Re: Null or empty collection
> That book says you _should_ return null
>
> On Sat, 17 Feb 2001, Wong Kok Wai wrote:
>
> > Got it. Also thanks to Robert Krueger whose reply I've just read. BTW,
this was
> > triggered as this "null collection" thingy is mentioned in the "Applying
> > Enterprise JavaBean" book.
> >
> > Gene Chuang wrote:
> >
> > > Return an empty collection; save the caller the hassle of
> > > NullPointerExceptions!
> > >
> > > Gene
> > >
> >
> >
===========================================================================
> > 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".
>
>
===========================================================================
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".