Re: Editing a fetch specification in an EOModel in Xcode 2.2?
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: Denis Stanton <email@hidden>
- Date: Tue, 22 Nov 2005 20:16:00 +1300
On 22/11/2005, at 8:18 AM, Mike Nowak wrote: 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.
Sorry, t's a long time since I build a fetch spec using the gui view in eomodeler. I can't remember how I did null date. I've just looked through an old eomodel which had some saved fetch specs in it , but none involved null, or nill, or nil so I don't know which is right
Denis
On Nov 21, 2005, at 1:53 PM, Denis Stanton wrote: Hi MikeOn 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
|
_______________________________________________
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