Return-Path: Delivered-To: apmail-incubator-cayenne-user-archive@locus.apache.org Received: (qmail 81783 invoked from network); 27 Apr 2006 23:32:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Apr 2006 23:32:17 -0000 Received: (qmail 98634 invoked by uid 500); 27 Apr 2006 23:32:16 -0000 Delivered-To: apmail-incubator-cayenne-user-archive@incubator.apache.org Received: (qmail 98613 invoked by uid 500); 27 Apr 2006 23:32:15 -0000 Mailing-List: contact cayenne-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cayenne-user@incubator.apache.org Delivered-To: mailing list cayenne-user@incubator.apache.org Received: (qmail 98604 invoked by uid 99); 27 Apr 2006 23:32:15 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Apr 2006 16:32:15 -0700 X-ASF-Spam-Status: No, hits=0.9 required=10.0 tests=DNS_FROM_RFC_WHOIS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of bryan@maine.rr.com designates 24.24.2.57 as permitted sender) Received: from [24.24.2.57] (HELO ms-smtp-03.nyroc.rr.com) (24.24.2.57) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Apr 2006 16:32:15 -0700 Received: from [192.168.1.242] (cpe-72-224-220-217.maine.res.rr.com [72.224.220.217]) by ms-smtp-03.nyroc.rr.com (8.13.6/8.13.6) with ESMTP id k3RNVnR9029913 for ; Thu, 27 Apr 2006 19:31:50 -0400 (EDT) Message-ID: <44515461.5080509@maine.rr.com> Date: Thu, 27 Apr 2006 19:31:45 -0400 From: Bryan Lewis User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cayenne-user@incubator.apache.org Subject: writeProperty() no longer useful for relationships Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Another little surprise we encountered with 1.2B2... dunno if it's a bug or only a documentation correction or neither. I had some code that used CayenneDataObject.writeProperty() to write a new object's attributes and to-one relationships. It made it easy to copy the values from a Map with keys named the same as the properties. This worked fine until now, and the javadocs say "This method can safely be used instead of or in addition to the auto-generated property modifiers in subclasses of CayenneDataObject." But now if I set a *relationship* with writeProperty() , the foreign key is left null in the generated SQL. Before commit, object = {; new [companyContact=>{} ... That's a to-one relationship on the key Contact_Nic_ID. Rest of properties omitted... The SQL is: INSERT INTO WEBSLOWPAY (CONTACT_NIC_ID, ...) VALUES (?, ...) [batch bind: NULL, ...] -- should be 109572 *** error. java.sql.SQLException: ORA-01400: cannot insert NULL ... It works fine if I change it to use the normal setter method setCompanyContact() or the equivalent setToOneTarget().