Here's one newbie trap to avoid
Here's one newbie trap to avoid
- Subject: Here's one newbie trap to avoid
- From: Scott Winn <email@hidden>
- Date: Fri, 26 Jan 2007 16:29:18 -0800
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:
This email sent to email@hidden