• 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: Editing a fetch specification in an EOModel in Xcode 2.2?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Editing a fetch specification in an EOModel in Xcode 2.2?


  • Subject: Re: Editing a fetch specification in an EOModel in Xcode 2.2?
  • From: Mike Nowak <email@hidden>
  • Date: Mon, 21 Nov 2005 14:18:14 -0500

Thanks for your response, Denis. I am trying to create a saved fetch specification in the eomodel file, rather than doing it programmatically. I used to be able to create a fetchspec in EOModeler like: letterDate <> nil.

On Nov 21, 2005, at 1:53 PM, Denis Stanton wrote:

Hi Mike

On 22/11/2005, at 7:25 AM, Mike Nowak wrote:

I switched over to Xcode 2.2, which is working pretty well for me, but I have run into trouble editing fetch specifications. Specifically, I want to be able to test one of my attributes in an entity to see if it is null. If I use the qualifier editor in Xcode, and try to say letterDate != null, it ends up as a letterDate != "null", which throws an eror at run time as it tries to compare this datetime column to a string. I thought I would try letterDate > 0000-00-00 but again, this is treated as a string. Would setting a valueType for this attribute (not sure to what) allow me to do date comparisons? Or do I have to use a dictionary binding?


You can't use null in a fetch spec like that.  You need NSKeyValueCoding.NullValue

Try something like 
new EOKeyValueQualifier("stopTimestamp", EOQualifier.QualifierOperatorEqual, NSKeyValueCoding.NullValue)

Also, if you are using a recent MySQL make sure you add the parameter to return zero dates as null.  This used to be the default, but they changed it.  Without this additional parameter on the database connection null dates will throw exceptions.
&zeroDateTimeBehavior=convertToNull


Denis Stanton
email@hidden




-- 

Mike Nowak

Work: http://healthmedia.umich.edu/

Personal: http://snackdog.org/


"Every devil I meet is an angel in disguise." -- Indigo Girls


 _______________________________________________
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: Editing a fetch specification in an EOModel in Xcode 2.2?
      • From: Denis Stanton <email@hidden>
    • Re: Editing a fetch specification in an EOModel in Xcode 2.2?
      • From: Lachlan Deck <email@hidden>
References: 
 >Editing a fetch specification in an EOModel in Xcode 2.2? (From: Mike Nowak <email@hidden>)
 >Re: Editing a fetch specification in an EOModel in Xcode 2.2? (From: Denis Stanton <email@hidden>)

  • Prev by Date: Re: Editing a fetch specification in an EOModel in Xcode 2.2?
  • Next by Date: Re: WebObjects Bugs
  • Previous by thread: Re: Editing a fetch specification in an EOModel in Xcode 2.2?
  • Next by thread: Re: Editing a fetch specification in an EOModel in Xcode 2.2?
  • Index(es):
    • Date
    • Thread