From open-jpa-dev-return-2095-apmail-incubator-open-jpa-dev-archive=incubator.apache.org@incubator.apache.org Tue Feb 13 08:02:33 2007 Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 36417 invoked from network); 13 Feb 2007 08:02:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Feb 2007 08:02:32 -0000 Received: (qmail 60795 invoked by uid 500); 13 Feb 2007 08:02:40 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 60688 invoked by uid 500); 13 Feb 2007 08:02:40 -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 60679 invoked by uid 99); 13 Feb 2007 08:02:40 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 00:02:40 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= 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; Tue, 13 Feb 2007 00:02:31 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 92FFA7142E4 for ; Tue, 13 Feb 2007 00:02:07 -0800 (PST) Message-ID: <8422422.1171353727338.JavaMail.jira@brutus> Date: Tue, 13 Feb 2007 00:02:07 -0800 (PST) From: "Marc Prud'hommeaux (JIRA)" To: open-jpa-dev@incubator.apache.org Subject: [jira] Commented: (OPENJPA-142) Entity name is ignored when specified in the orm.xml file In-Reply-To: <20312105.1171353545532.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12472557 ] Marc Prud'hommeaux commented on OPENJPA-142: -------------------------------------------- This can be worked around by adding the annotation to the class (e.g., @Entity(name="Foo") ). > Entity name is ignored when specified in the orm.xml file > --------------------------------------------------------- > > Key: OPENJPA-142 > URL: https://issues.apache.org/jira/browse/OPENJPA-142 > Project: OpenJPA > Issue Type: Bug > Components: jpa > Reporter: Marc Prud'hommeaux > > The XMLPersistenceMetaDataParser ignores the "name" attriburte of an "entity" element, and instead always uses the default alias. For example, with the following declaration in the orm.xml file: > > the entity will be aliased to "Bar", rather than to "Foo". > Original report by Dain Sundstrom on the open-jpa-dev mailing list: > I'm using 0.9.6 and it appears the OpenJPA is ignoring the entity name when processing queries. In stead it seems to always choose the class name for the schema name of the bean. For example, I have the following bean declared in my entity mappings: > > BasicCmp2Bean > > > > > > > The following query does not work: > SELECT o FROM BasicCmp2Bean o WHERE o.lastName = ?1 > But this one does: > SELECT o FROM BasicCmp2Bean_BasicCmp2Bean o WHERE o.lastName = ?1 > When the query fails, I get this message (reformatted a bit with ** added to important entries): > ERROR - The bean instances business method encountered a system exception: Could not locate metadata for the class using alias "BasicCmp2Bean". Registered alias mappings: "{ > AllowedOperationsCmp2Bean_AOBasicCmp2Bean= > [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmp2Bean_AOBasicCmp2Bean], > AllowedOperationsCmpBean= > [class org.apache.openejb.test.entity.cmp.AllowedOperationsCmpBean], > ContextLookupCmpBean= > [class org.apache.openejb.test.entity.cmp.ContextLookupCmpBean], > Employee= > [class org.apache.openejb.test.entity.cmp2.Employee], > ManyOwningSideBean_ManyOwningSideBean= > [class org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideBean_ManyOwningSideBean], > **BasicCmp2Bean_BasicCmp2Bean= > [class org.apache.openejb.test.entity.cmp.BasicCmp2Bean_BasicCmp2Bean], > EncCmpBean= > [class org.apache.openejb.test.entity.cmp.EncCmpBean], > BBean_OneToOneB= > [class org.apache.openejb.test.entity.cmr.onetoone.BBean_OneToOneB], > OneOwningSideBean_OneOwningSideBean= > [class org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideBean_OneOwningSideBean], > ABean_OneToOneA= > [class org.apache.openejb.test.entity.cmr.onetoone.ABean_OneToOneA], > **BasicCmp2Bean=null, > RmiIiopCmpBean= > [class org.apache.openejb.test.entity.cmp.RmiIiopCmpBean], > ABean_OneToManyA= > [class org.apache.openejb.test.entity.cmr.onetomany.ABean_OneToManyA], > OneInverseSideBean_OneInverseSideBean= > [class org.apache.openejb.test.entity.cmr.cmrmapping.OneInverseSideBean_OneInverseSideBean], > BBean_OneToManyB= > [class org.apache.openejb.test.entity.cmr.onetomany.BBean_OneToManyB], > RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean= > [class org.apache.openejb.test.entity.cmp.RmiIiopCmp2Bean_Cmp2_RMI_IIOP_Bean], > EncCmp2Bean_EncCmp2Bean= > [class org.apache.openejb.test.entity.cmp.EncCmp2Bean_EncCmp2Bean], > BasicCmpBean= > [class org.apache.openejb.test.entity.cmp.BasicCmpBean]}" -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.