Re: objectsWithQualifierFormat
Re: objectsWithQualifierFormat
- Subject: Re: objectsWithQualifierFormat
- From: Chuck Hill <email@hidden>
- Date: Wed, 9 Dec 2009 19:26:11 -0800
On Dec 9, 2009, at 7:08 PM, Strumyla, Marius wrote:
I would really appreciate if somebody could tell me why I'm getting an
exception here :(
EOKeyValueQualifier qDob = new EOKeyValueQualifier("recordDate",
EOQualifier.QualifierOperatorGreaterThan,
new NSTimestamp(1977, 2, 14, 0, 0,
0, NSTimeZone.getDefault()));
EOUtilities
.objectsWithQualifierFormat(session().defaultEditingContext()
,
"Log",
qDob.toString(),
null);
Your problem is this:
qualifier != qualifier format
qualifier.toString() != qualifier format
I think this is what you want:
EOUtilities
.objectsWithQualifierFormat(session().defaultEditingContext(),
"Log", "recordDate > %@",
new NSTimestamp(1977, 2, 14, 0, 0,0, NSTimeZone.getDefault()));
If you want to use a qualifier, you need to make an
EOFetchSpecification and see
http://developer.apple.com/legacy/mac/library/documentation/MacOSXServer/Reference/WO54_Reference/com/webobjects/eocontrol/EOEditingContext.html#objectsWithFetchSpecification(com.webobjects.eocontrol.EOFetchSpecification)
Chuck
I'm using WO5.2.4 on Windows. Below is the exception. recordDate
type is
T.
[2009-12-09 21:59:55 EST] <WorkerThread2>
com.webobjects.foundation.NSForwardException for
com.webobjects.foundation.NSForwardException for
com.webobjects.eocontrol._private.ParseException: Encountered
"com.webobjects.foundation.NSTimestamp" at line 1, column 16.
Was expecting:
<IDENTIFIER> ...
at
com
.webobjects.eocontrol._private._EOQualifierParser.generateParseExcept
ion(_EOQualifierParser.java:1044)
at
com
.webobjects.eocontrol._private._EOQualifierParser.jj_consume_token(_E
OQualifierParser.java:980)
at
com
.webobjects.eocontrol._private._EOQualifierParser.CastedValueExpressi
on(_EOQualifierParser.java:742)
at
com
.webobjects.eocontrol._private._EOQualifierParser.parseValue(_EOQuali
fierParser.java:434)
at
com
.webobjects.eocontrol._private._EOQualifierParser.parseValueList(_EOQ
ualifierParser.java:498)
at
com
.webobjects.eocontrol._private._EOQualifierParser.RelOpExpression(_EO
QualifierParser.java:651)
at
com
.webobjects.eocontrol._private._EOQualifierParser.Expression(_EOQuali
fierParser.java:594)
at
com
.webobjects.eocontrol._private._EOQualifierParser.parseLogicalExpress
ion(_EOQualifierParser.java:872)
at
com
.webobjects.eocontrol._private._EOQualifierParser.ParenExpression(_EO
QualifierParser.java:616)
at
com
.webobjects.eocontrol._private._EOQualifierParser.Expression(_EOQuali
fierParser.java:598)
at
com
.webobjects.eocontrol._private._EOQualifierParser.parseLogicalExpress
ion(_EOQualifierParser.java:872)
at
com
.webobjects.eocontrol.EOQualifier.qualifierWithQualifierFormat(EOQual
ifier.java:941)
at
com
.webobjects.eoaccess.EOUtilities.objectsWithQualifierFormat(EOUtiliti
es.java:142)
--
i5mast
_______________________________________________
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
--
Chuck Hill Senior Consultant / VP Development
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