Return-Path: X-Original-To: apmail-cayenne-user-archive@www.apache.org Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 18201DD04 for ; Thu, 12 Jul 2012 09:15:26 +0000 (UTC) Received: (qmail 22925 invoked by uid 500); 12 Jul 2012 09:15:25 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 22477 invoked by uid 500); 12 Jul 2012 09:15:17 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 22389 invoked by uid 99); 12 Jul 2012 09:15:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2012 09:15:14 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [41.193.4.186] (HELO smtpout7.voxtelecom.co.za) (41.193.4.186) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2012 09:15:06 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq4CAFuU/k/EKQalgWdsb2JhbABFpQWScSIBARYmJ4JZAT8cEyeBE4d6CJwmoUaOIIMcA5syjG8 X-IronPort-AV: E=Sophos;i="4.77,573,1336341600"; d="scan'208";a="460828404" Received: from unknown (HELO webmail.xsinet.co.za) ([196.41.6.165]) by smtpout.vox.co.za with ESMTP; 12 Jul 2012 11:14:42 +0200 Received: from 209.212.102.102 (SquirrelMail authenticated user dollj@xsinet.co.za) by webmail.xsinet.co.za with HTTP; Thu, 12 Jul 2012 11:14:41 +0200 (SAST) Message-ID: <9211.209.212.102.102.1342084481.squirrel@webmail.xsinet.co.za> Date: Thu, 12 Jul 2012 11:14:41 +0200 (SAST) Subject: Date cast exception due to relationship From: dollj@xsinet.co.za To: user@cayenne.apache.org User-Agent: SquirrelMail/1.4.11 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Checked: Checked by ClamAV on apache.org 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