Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 91578 invoked from network); 30 Oct 2008 08:40:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2008 08:40:35 -0000 Received: (qmail 25330 invoked by uid 500); 30 Oct 2008 08:40:40 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 25301 invoked by uid 500); 30 Oct 2008 08:40:40 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 25290 invoked by uid 99); 30 Oct 2008 08:40:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Oct 2008 01:40:40 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [217.146.182.11] (HELO web27806.mail.ukl.yahoo.com) (217.146.182.11) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 30 Oct 2008 08:39:23 +0000 Received: (qmail 35359 invoked by uid 60001); 30 Oct 2008 08:40:01 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=ZoqjOiVLPEkWi6qRSS9fmkOPqlfGbgxn6j0Hi77h5wVTbXCZ+LmzDIZj9gr5ZXM2DEZEzm6L/7hcl2ufPSC5gr47O8Gt1fUS2w4AJJiywxEFhNuTWa+E4CMtblQCzVURUNDec5vxs5NNcpKjTmqoFRJ6dzyKZ3LM5pJ1PlbMJ7M=; X-YMail-OSG: cmAmDHsVM1neWfpCk908JrPAH8595MDjBw28Xse6WEK5aDOGcKY1qGESW8pR0YtQJnPzv8B7_5uniO48Mj0a4dG1_jSLD2fVM_ZEO9av8mvmGHQU4QPgoH7GTGw9qhob0AJ3B7gcF9NOdXTIMZYycsgYbYgU3i.PCjB9ZHk- Received: from [81.19.198.7] by web27806.mail.ukl.yahoo.com via HTTP; Thu, 30 Oct 2008 08:40:01 GMT X-Mailer: YahooMailWebService/0.7.247.3 Date: Thu, 30 Oct 2008 08:40:01 +0000 (GMT) From: Mark Struberg Subject: multiple usage of @Embedded in one entity To: dev@openjpa.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <709940.34205.qm@web27806.mail.ukl.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi! I have a JPA2.0 question. I did find some discussion (better: complaints) about embedding members of = the same class multiple times, but could not find the information about how= this will be solved in the JSR-317 draft. So maybe anyone can point me to = some information about this. I've used kodo for a long time, and I know that that the code already exist= s and did work with JDO. Here is my problem: Imagine having a @Embeddable public class Address { private String zip; private String city; private String street; ... } and you like to use this Address multiple times in another entity: @Entity public class Customer { private String name @Embedded private Address deliveryAddress; @Embedded private Address invoiceAddress; } This does not work out as expected, since the created SQL does only generat= e ONE set of the fields (and _silently_ skipping the 2nd Address!). This can be worked around by using @AttributeOverrides, but you will get in= to troubles if the Address also contains an embedded field (eg '@Embeddable= public class Contact' containing tel, fax, email) since you cannot control= these names via the attribute overrides anymore. So, I'd like to know if it is likely that there is anything like=20 @Embedded(prefix=3D"INVOICE") @Embedded(prefix=3D"DELIVER") with an automated default mechanism like kodo-JDO had? (and please don't argue that addresses should stored in a 1:n table anyway = - this is only an example ;) txs and LieGrue, strub =0A=0A=0A