Re: Here's one newbie trap to avoid
Re: Here's one newbie trap to avoid
- Subject: Re: Here's one newbie trap to avoid
- From: Clark Mueller <email@hidden>
- Date: Fri, 26 Jan 2007 17:48:44 -0700
Scott,
It doesn't throw, it just returns an empty array... which IMO
generally makes good sense.
Regards,
Clark
On 26 Jan 07, at 5:36 PM, Chuck Hill wrote:
All of the EOUtilities.objectsWith (note plural objects) don't
throw an exception if zero rows are returned. This is documented
in the API and seems like the correct behavior to me.
The exception that it is throwing if it can't find the fetch spec
does seem like a bug.
Chuck
On Jan 26, 2007, at 4:29 PM, Scott Winn wrote:
EOUtilities.objectWithFetchSpecificationAndBindings
throws EOObjectNotAvailableException - if there is no matching
object, so far so good.
You do a fetch with no results and get an
EOObjectNotAvailableException. But watch out for. . .
EOUtilities.objectsWithFetchSpecificationAndBindings
it throws EOObjectNotAvailableException, but only if it can't find
the fetch specification.
If you are used to the way object (singular)
WithFetchSpecAndBindings behaves you are out of luck with this
one. You do a fetch with no results and get no exception. You
may have been expecting an EOObjectNotAvailableException, but you
are never going to get it. Why didn't someone come up with an
EONoFetchSpec exception instead? What does
objectWithFetchSpecificationAndBindings throw if it can't find the
fetch spec? Anything?
It's so subtle it is almost evil. Just glad I didn't waste too
much time with it. One more newbie trap to avoid, but at least it
is in the documentation.
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden