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 07:53:08 +1300
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