On 30/01/2011, at 6:50 PM, Theodore Petrosky wrote:

> I have an EO with attributes that are dates in the postgresql db.
> 
> invoiceBookedDate is a date. It is modeled as a LocalDate.

This sounds right.  (I'm assuming that you've followed Henrique's example 
closely, and that "LocalDate" there is in some package of your own, and that it 
contains an org.joda.time.LocalDate as a private field.  Looks like it from 
your stack trace.)

> In my UI, I have an AjaxDatePicker which appears to only create NSTimestamps. 
> So I create a cover methods (setter and getter) that accept the NSTimestamp 
> and convert LocalDates.

As an aside, that's probably alright just going to or from the UI, but be 
careful.  The point of the LocalDate exercise was to avoid the problems that 
arise representing a 1-day resolution date as full-resolution timestamp.

> invoiceList = Invoice.fetchInvoices(versionListEC, 
> ERXQ.equals(Invoice.INVOICE_BOOKED_DATE_KEY, theLocalDate()), null);
> 
> works beautifully to get the list of all Invoices booked on the date from the 
> AjaxDatePicker.

That's a good sign.  As you observe, you should be able to use LocalDates 
directly in qualifiers.  It suggests you've set up the custom attribute type 
correctly.

> but when I try to populate the JasperReport using the WOWODC 2010 example, I 
> get errors.

I've never used JasperReports, so I don't have much to offer from this point 
onwards.

> Jan 30 08:03:52 TheWorkTracker[56046] ERROR 
> er.jasperreports.ERJRFetchSpecificationReportTask  - Error in JR task
> ClassCastException: com.eltek.utilities.LocalDate cannot be cast to 
> java.util.Date
>  at 
> BillingToday_1296250490999_974810.evaluate(BillingToday_1296250490999_974810:171)

So the exception is coming from somewhere deep within JasperReports.  Again, I 
don't know anything about how it works, but I'd be asking why JR is trying to 
cast that to a Date.  Have you told it to expect some attribute to be a 
java.util.Date?


-- 
Paul.

http://logicsquad.net/


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to