EOQualifier timestamp comparison help
EOQualifier timestamp comparison help
- Subject: EOQualifier timestamp comparison help
- From: LD <email@hidden>
- Date: Fri, 19 Aug 2005 07:26:13 +1000
Hi there,
I've got a list of shared entities and one of them is causing
problems during the initial fetch. i.e., my EOQualifier is the
problem as when "recentPurchasesQualifier" returns null instead of
the normal qualifier (see below) everything's fine.
More specifically, it's the "%s > %@" portion of the qualifier (i.e.,
the timestamp comparison) that's giving me grief. Any ideas on why
this causes problems? The timestamp column's external type is
"timestamp", Value Class: "NSCalendarDate", Value: "T"
I'm using PostgreSQL 8.02, WO5.2.4, Mac OS X 10.4.2, Xcode 2.0.
Thanks.
(Below is the FetchSpecification used and the runtime exception,
though there's nothing special in Main that's worth seeing seeing as
it's the qualifier causing the problems).
with regards,
--
LD
public class Purchase extends EOGenericRecord {
<...>
static EOQualifier recentPurchasesQualifier() {
NSMutableArray args;
args = new NSMutableArray();
args.addObject( "timestamp" );
args.addObject( recentPurchasePeriodTimestamp() );
args.addObject( "accountsInvoiceNumber" );
args.addObject( EOKeyValueCoding.NullValue );
args.addObject( "deliveryConsignmentNumber" );
args.addObject( EOKeyValueCoding.NullValue );
return EOQualifier.qualifierWithQualifierFormat( "%s > %@
AND %s = %@ AND %s = %@", args );
}
static NSArray purchaseSortOrderings() {
return new NSArray( EOSortOrdering.sortOrderingWithKey
( "timestamp", EOSortOrdering.CompareAscending ) );
}
public static EOFetchSpecification FetchSpecification() {
return new EOFetchSpecification( "Purchase",
recentPurchasesQualifier(), purchaseSortOrderings() );
}
<...>
}
[2005-08-19 06:51:48 EST] <main> Creating LifebeatThread now with:
BFMOnlineStore 55555 localhost/127.0.0.1 1085 30000
Welcome to BFMOnlineStore!
sharedEditingContext is set...
Initializing PostgresqlPlugin
Refetch error for entity: Purchase
java.lang.NullPointerException
at
com.webobjects.eoaccess.EOAttribute.adaptorValueByConvertingAttributeVal
ue(EOAttribute.java:2020)
at com.webobjects.jdbcadaptor.JDBCColumn.takeInputValue
(JDBCColumn.java:562)
at
com.webobjects.jdbcadaptor.JDBCChannel._bindInputVariablesWithBindingsAn
dExecute(JDBCChannel.java:226)
at com.webobjects.jdbcadaptor.JDBCChannel._evaluateExpression
(JDBCChannel.java:303)
at com.webobjects.jdbcadaptor.JDBCChannel.evaluateExpression
(JDBCChannel.java:261)
at com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes
(JDBCChannel.java:185)
at
com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationE
ditingContext(EODatabaseChannel.java:879)
at
com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecific
ation(EODatabaseChannel.java:216)
at
com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecification
EditingContext(EODatabaseContext.java:3206)
at
com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(
EODatabaseContext.java:3347)
at
com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecif
ication(EOObjectStoreCoordinator.java:539)
at
com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(
EOEditingContext.java:4075)
at
com.webobjects.eocontrol.EOSharedEditingContext.objectsWithFetchSpecific
ation(EOSharedEditingContext.java:349)
at Application.refetchSharedRecordsForNamedEntity
(Application.java:98)
at Application.<init>(Application.java:60)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at com.webobjects.appserver.WOApplication.main
(WOApplication.java:323)
at Application.main(Application.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.webobjects._bootstrap.WOBootstrap.main(WOBootstrap.java:71)
[2005-08-19 06:51:48 EST] <main> The URL for webserver connect is:
http://localhost/cgi-bin/WebObjects/BFMOnlineStore.woa/-55555
The URL for direct connect is:
http://localhost:55555/cgi-bin/WebObjects/BFMOnlineStore.woa
[2005-08-19 06:51:48 EST] <main> null
[2005-08-19 06:51:48 EST] <main> Waiting for requests...
_______________________________________________
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