Re: Help with Qualifier and NSKeyValueCoding.NullValue
Re: Help with Qualifier and NSKeyValueCoding.NullValue
- Subject: Re: Help with Qualifier and NSKeyValueCoding.NullValue
- From: Kieran Kelleher <email@hidden>
- Date: Tue, 11 Apr 2006 23:58:11 -0400
Thanks Chuck .... ah sure you're a genius! You are exactly right. I,
with the help of the "working-better-than-ever-in-xcode-2.2.1"
CodeSense add endQualifiersArray instead of endQualifiers to my final
EOAndQualifier. I noticed that log statement was not right with the
comma, but I was as blind as a bat and _still_ thought after treble-
checking my code that I did not have a mistake!!! Working fine now,
here is the new log output:
16819 DEBUG [Thread-1] (STEDispatchTimerTask, run, 22) -
running timer task...
16827 DEBUG [Thread-1] (STEDispatcher, processScheduledTasks, 76) -
endQualifiers = ((endDate = null) or (endDate >=
(com.webobjects.foundation.NSTimestamp)'2006-04-12 03:52:38 Etc/GMT'))
16829 DEBUG [Thread-1] (STEDispatcher, processScheduledTasks, 92) -
totalQualifier = ((startDate <=
(com.webobjects.foundation.NSTimestamp)'2006-04-12 03:52:38 Etc/GMT')
and ((endDate = null) or (endDate >=
(com.webobjects.foundation.NSTimestamp)'2006-04-12 03:52:38 Etc/
GMT')) and (nextEventDue <=
(com.webobjects.foundation.NSTimestamp)'2006-04-12 03:52:38 Etc/GMT'))
16833 DEBUG [Thread-1] (STEDispatcher, processScheduledTasks, 106) -
Fetch Spec = <class com.webobjects.eocontrol.EOFetchSpecification
(entityName=CTScheduledTask,
qualifier=((startDate <=
(com.webobjects.foundation.NSTimestamp)'2006-04-12 03:52:38 Etc/GMT')
and ((endDate = null) or (endDate >=
(com.webobjects.foundation.NSTimestamp)'2006-04-12 03:52:38 Etc/
GMT')) and (nextEventDue <=
(com.webobjects.foundation.NSTimestamp)'2006-04-12 03:52:38 Etc/GMT')),
isDeep=false, usesDistinct=false,
sortOrdering=(<class com.webobjects.eocontrol.EOSortOrdering
(nextEventDue compareAscending)>),
hints=null,
_prefetchingRelationshipKeyPaths = null)>
On Apr 11, 2006, at 5:56 PM, Chuck Hill wrote:
I think that Francis gets the prize here. This looks very wrong:
... and ((endDate = null), (endDate >=
(com.webobjects.foundation.NSTimestamp)'2006-04-11 16:36:06 Etc/
GMT')) and ...
That , should not be there after (endDate = null). In a properly
formed qualifier it would be AND or OR. It looks like you have a
passed an array of qualifiers to something expecting a single
qualifier.
I will make a prediction (waves magic scarf and all that), if you
check your code you will see that when you add this qualifier you
have passed an array containing an array of qualifiers to
EOAndQualifier or EOOrQualifier instead of passing just an array of
qualifiers. That is you are passing ((qual1, qual2)) instead of
(qual1, qual2).
Chuck
On Apr 11, 2006, at 1:40 PM, Kieran Kelleher wrote:
I just did a simple test and on its own this qualifier works as
shown coded below!! .... It does not make sense why adding this
qualifer into a larger qualifier, which works without this one,
would cause this problem .... Maybe its a bug .... but usually I
find it's me is the problem ...... I'll try setting it up in a
fetch spec in EOModeler and see how that goes.
EOQualifier endEqualsNullQualifier = new
EOKeyValueQualifier( "endDate",
EOQualifier.QualifierOperatorEqual,
NSKeyValueCoding.NullValue );
EOFetchSpecification simpleTestFs = new
EOFetchSpecification( "CTScheduledTask",
endEqualsNullQualifier,
null,
false,
false,
null );
NSArray simpleTestFsArray =
ec.objectsWithFetchSpecification( simpleTestFs );
if ( log.isDebugEnabled() ) log.debug
("simpleTestFsArray = " + simpleTestFsArray );
On Apr 11, 2006, at 3:23 PM, Art Isbell wrote:
On Apr 11, 2006, at 9:08 AM, Kieran Kelleher wrote:
When I include this qualifier in a qualifier constructed of
other qualifiers ANDed and ORed, I get the stack trace shown
below. If I leave it out of the qualifier construct, I have no
problems. Any idea why this is wrong? endDate is an NSTimestamp
mapped to DateTime column.
EOQualifier endEqualsNullQualifier = new
EOKeyValueQualifier( "endDate",
EOQualifier.QualifierOperatorEqual,
NSKeyValueCoding.NullValue );
Exception while processing scheduled tasks
java.lang.ClassCastException
Maybe the class cast exception occurs because endDate is a
NSTimestamp, not a NSKeyValueCoding.Null. I've never used
NSKeyValueCoding.NullValue to signify null in a qualifier. Have
you tried "null" instead?
Aloha,
Art
--
Coming in 2006 - an introduction to web applications using
WebObjects and Xcode http://www.global-village.net/wointro
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