From dev-return-11676-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Mon May 04 18:01:00 2009 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 91959 invoked from network); 4 May 2009 18:01:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 May 2009 18:01:00 -0000 Received: (qmail 84443 invoked by uid 500); 4 May 2009 18:01:00 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 84376 invoked by uid 500); 4 May 2009 18:01:00 -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 84366 invoked by uid 99); 4 May 2009 18:01:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 18:01:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 18:00:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5141B234C003 for ; Mon, 4 May 2009 11:00:30 -0700 (PDT) Message-ID: <1083497246.1241460030320.JavaMail.jira@brutus> Date: Mon, 4 May 2009 11:00:30 -0700 (PDT) From: "Martin Dirichs (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Created: (OPENJPA-1059) Unnecessary creation of OPENJPA_SEQUENCE_TABLE for embeddable classes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Unnecessary creation of OPENJPA_SEQUENCE_TABLE for embeddable classes --------------------------------------------------------------------- Key: OPENJPA-1059 URL: https://issues.apache.org/jira/browse/OPENJPA-1059 Project: OpenJPA Issue Type: Bug Components: jdbc Affects Versions: 1.2.1, 2.0.0 Reporter: Martin Dirichs Priority: Minor Using OpenJPA with all identity values generated by the datastore does not trigger the creation of OPENJPA_SEQUENCE_TABLE. However, as soon as a embeddable class is used, this table is being created although embeddable classes do not have a persistent identity on their own. Example ======= MainEntity.java: import javax.persistence.*; @Entity public class MainEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) int id; @Embedded EmbeddedClass e; // Referencing the embedded class yields the bug } EmbeddedClass: import javax.persistence.*; @Embeddable public class EmbeddedClass { String someValue; } META-INF/persistence.xml: MainEntity EmbeddedClass Running org.apache.openjpa.jdbc.meta.MappingTool for the above two classes results in the creation of OPENJPA_SEQUENCE_TABLE. This is not the case if the reference to the embedded class is removed from MainEntity. According to Micheal Dick, there might be some use case where this behaviour is desired. However, since the sequence table is used to generate id values and embeddable classes have no id fields at all, it seems more likely to be a bug. See here for the mailing list discussion: http://n2.nabble.com/OPENJPA_SEQUENCE_TABLE-created-unnecessarily-for-embeddable-classes-tc2787226.html -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.