Return-Path: Delivered-To: apmail-openjpa-users-archive@locus.apache.org Received: (qmail 49909 invoked from network); 28 Jun 2007 17:42:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Jun 2007 17:42:57 -0000 Received: (qmail 17211 invoked by uid 500); 28 Jun 2007 17:42:53 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 17180 invoked by uid 500); 28 Jun 2007 17:42:53 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 17163 invoked by uid 99); 28 Jun 2007 17:42:53 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 10:42:53 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of christian.defoy@gmail.com designates 66.249.82.232 as permitted sender) Received: from [66.249.82.232] (HELO wx-out-0506.google.com) (66.249.82.232) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 10:42:49 -0700 Received: by wx-out-0506.google.com with SMTP id s7so250752wxc for ; Thu, 28 Jun 2007 10:42:28 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=bNvHHVgq5eVg97b60qkuVFyaRIvSrhixsK3MCgeots6hceJMGD8nlRofMvLwx051N+Qnn38NkcMowYDAbGuzKRZFLhacpgdEofF7G+6MTABF2nZlY5epCaAGY+JPQwPUQ0plNWqgB+QNV03GKWgc7bM1zhXwaGBEj160+0peyMg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=X4GeDj1ZJYZpSxh5RbfYgEZvt9/sgNeGkGIlgCjGbzOBFiIPhpcuV+ovux60Jw15Mf/VRUz97EvlM5rmgKmq7Nq7l+QmHWDmhzfPqss94gVAiD8lCTEFeXhA4mADvupQPM3j0P9FZtF9lk/H4wsWXvSdUsCS6iBIbYfFvxpfOiM= Received: by 10.90.71.3 with SMTP id t3mr2110853aga.1183052548583; Thu, 28 Jun 2007 10:42:28 -0700 (PDT) Received: by 10.90.52.9 with HTTP; Thu, 28 Jun 2007 10:42:28 -0700 (PDT) Message-ID: <967946b0706281042g2842aa47w3ed2c3c91e8946c9@mail.gmail.com> Date: Thu, 28 Jun 2007 13:42:28 -0400 From: "Christian Defoy" To: users@openjpa.apache.org Subject: Embedded entities are deleted last MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org Hello! I am trying to get the existing object model from our system to persist correctly with openjpa. Here's the situation. I have an object A that contains a link to objects B and C. A will contain either a link to B or a link to C, never to both. I tried two approaches with openjpa to persist object A: one-to-one relationship to B and to C and declaring B and C as embedded entities of A. Both approaches worked fine except that with the embedded entities I ran into two problems I was not able to resolve: 1. I was not able to specify the name of the key for tables containing B and C. The generated names were: B_id and C_id but the actual value is the id of A... Is there a way to specify the name of the column for that value? 2. When I tried to delete object A, I got a constraint violation since objects B and C are not deleted yet (there is a foreign key in the DB for this). Is it normal that B and C are deleted after A since they do not have a life of their own? By the way, I am using Hypersonic version 1.8.0.4 and the latest official release of openjpa (0.9.7). Thanks in advance! Christian