• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Here's one newbie trap to avoid
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Here's one newbie trap to avoid


  • Subject: Re: Here's one newbie trap to avoid
  • From: Chuck Hill <email@hidden>
  • Date: Fri, 26 Jan 2007 16:36:06 -0800

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Here's one newbie trap to avoid
      • From: Scott Winn <email@hidden>
    • Re: Here's one newbie trap to avoid
      • From: Clark Mueller <email@hidden>
References: 
 >Here's one newbie trap to avoid (From: Scott Winn <email@hidden>)

  • Prev by Date: Here's one newbie trap to avoid
  • Next by Date: Re: Here's one newbie trap to avoid
  • Previous by thread: Here's one newbie trap to avoid
  • Next by thread: Re: Here's one newbie trap to avoid
  • Index(es):
    • Date
    • Thread