Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 11875 invoked from network); 7 May 2007 17:00:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 May 2007 17:00:36 -0000 Received: (qmail 17408 invoked by uid 500); 7 May 2007 17:00:42 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 17381 invoked by uid 500); 7 May 2007 17:00:42 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 17372 invoked by uid 99); 7 May 2007 17:00:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 May 2007 10:00:42 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 May 2007 10:00:35 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4A6B971403B for ; Mon, 7 May 2007 10:00:15 -0700 (PDT) Message-ID: <22224791.1178557215279.JavaMail.jira@brutus> Date: Mon, 7 May 2007 10:00:15 -0700 (PDT) From: "David Ezzio (JIRA)" To: open-jpa-dev@incubator.apache.org Subject: [jira] Created: (OPENJPA-236) No apparent way to generate all required SQL within a class derived from FullClassStrategy MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org No apparent way to generate all required SQL within a class derived from FullClassStrategy ------------------------------------------------------------------------------------------ Key: OPENJPA-236 URL: https://issues.apache.org/jira/browse/OPENJPA-236 Project: OpenJPA Issue Type: Bug Reporter: David Ezzio FullClassStrategy has several optional methods for overriding OpenJPA's generation of SQL. However, in a simple case, there is no apparent way to generate the required SQL within a class derived from FullClassStrategy. The model consists of two classes, BizA which has a one-way, one-to-many relationship to BizB. The relationship is mapped with an inverse key within the BizB table. The custom class strategy BizBMapping attempts to insert a BizB record and is able to do so, provided that it is not contained within a BizA collection. Otherwise, the attempt to persist a BizA with a contained BizB yields a SQL exception because OpenJPA generates additional SQL that conflicts with the SQL generated within BizBMapping.customInsert. Even if OpenJPA did not generate conflicting insert statement, there is no apparent way to get the value for the A_ID column within the BizBMapping.customInsert method. This issue is critical for users who want to substitute their own SQL (such as calls to stored procedures) for all of the OpenJPA generated SQL. Synopsis of the output log: INSERT INTO BIZB (ID, INFO) VALUES (?, ?) [params=(String) B22047141, (String) random] INSERT INTO BizA (id, info) VALUES (?, ?) [params=(String) A32968849, (String) random] INSERT INTO BizB (A_ID) VALUES (?) [params=(String) A32968849] SQLException: Column 'ID' cannot accept a NULL value. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.