Re: EOQualifier timestamp comparison help [i.e., exception]
Re: EOQualifier timestamp comparison help [i.e., exception]
- Subject: Re: EOQualifier timestamp comparison help [i.e., exception]
- From: email@hidden
- Date: Fri, 19 Aug 2005 10:42:27 +0200
Did you double-check that the timestamp
attribute is of value class NSTimestamp? Do you have a valid value type
(e.g. 'T') ?
Pierre
webobjects-dev-bounces+pierre.bernard=email@hidden
wrote on 08/19/2005 12:32:49 AM:
> Hi again,
>
> I still can't figure out why the qualifier (below) is causing a
> java.lang.NullPointerException. If I specify null for the qualifier
> in the FetchSpecification - it works without a problem - but
> utilising the ( EOQualifier )recentPurchasesQualifier below causes
a
> RuntimeException.
>
> Any help?
>
> the toString output of my qualifier is as follows:
> ((timestamp > (com.webobjects.foundation.NSTimestamp)'2005-07-06
> 00:00:15 Etc/GMT') and (accountsInvoiceNumber = null) and
> (deliveryConsignmentNumber = null))
>
> Thanks.
>
> On 19/08/2005, at 7:26 AM, LD wrote:
>
> > <...>
> > (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).
> >
> > 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.adaptorValueByConvertingAttributeV
> > alue(EOAttribute.java:2020)
> > at com.webobjects.jdbcadaptor.JDBCColumn.takeInputValue
> > (JDBCColumn.java:562)
> > at
> > com.webobjects.jdbcadaptor.JDBCChannel._bindInputVariablesWithBindings
> > AndExecute(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._selectWithFetchSpecificatio
> > nEditingContext(EODatabaseChannel.java:879)
> > at
> > com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecif
> > ication(EODatabaseChannel.java:216)
> > at
> > com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificati
> > onEditingContext(EODatabaseContext.java:3206)
> > at
> > com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecificatio
> > n(EODatabaseContext.java:3347)
> > at
> > com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpec
> > ification(EOObjectStoreCoordinator.java:539)
> > at
> > com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecificatio
> > n(EOEditingContext.java:4075)
> > at
> > com.webobjects.eocontrol.EOSharedEditingContext.objectsWithFetchSpecif
> > ication(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...
>
> with regards,
> --
>
> LD
>
>
> _______________________________________________
> 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
>
**********************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender
of this message. (email@hidden)
This email message has been checked for the presence of computer
viruses; however this protection does not ensure this message is
virus free.
Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
**********************************************************************
_______________________________________________
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