You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by do...@xsinet.co.za on 2012/07/12 11:14:41 UTC
Date cast exception due to relationship
I have an Activity table and associated class containing a sql.Date field.
I also have a Results table (also with a date field) and associated
ActivityResults class.
At this point the model works without error.
However when i create a 1-M relationship, using Cayenne modeler, in
Activity to ActivityResults (partly based on the date fields) then i get
an util.Date to sql.Date cast exception in the _Activity class here:
return (Date)readProperty("activityDate");
It seems as though the relationship is causing Cayenne to switch
internally from creating a sql.Date to a util.Date ? This is then
returned by readProperty() and causes the cast exception because _Activity
is expecting a sql.Date
This behavior occurs in 3.0.2 and in 3.1b1