Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 32506 invoked from network); 20 Feb 2007 16:09:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2007 16:09:28 -0000 Received: (qmail 10536 invoked by uid 500); 20 Feb 2007 16:09:35 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 10506 invoked by uid 500); 20 Feb 2007 16:09:35 -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 10366 invoked by uid 99); 20 Feb 2007 16:09:35 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Feb 2007 08:09:34 -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, 20 Feb 2007 08:09:26 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E105D7141E2 for ; Tue, 20 Feb 2007 08:09:05 -0800 (PST) Message-ID: <30217337.1171987745919.JavaMail.jira@brutus> Date: Tue, 20 Feb 2007 08:09:05 -0800 (PST) From: "Abe White (JIRA)" To: open-jpa-dev@incubator.apache.org Subject: [jira] Commented: (OPENJPA-146) Entity enhancement fails while using EmbeddedId on a MappedSuperclass In-Reply-To: <30768044.1171454423675.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-146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474480 ] Abe White commented on OPENJPA-146: ----------------------------------- Cancel my previous comment. Embedded PCs are handled very differently than OIDs at runtime, and so changing the isEmbeddedPC method to encompass OIDs as well might cause problems. I think the root of the problem has to do with metadata resolution of mapped superclass fields (after all, EmbeddedIds in Entities work fine, just not in MappedSuperclasses). I'll investigate further. > Entity enhancement fails while using EmbeddedId on a MappedSuperclass > --------------------------------------------------------------------- > > Key: OPENJPA-146 > URL: https://issues.apache.org/jira/browse/OPENJPA-146 > Project: OpenJPA > Issue Type: Bug > Components: kernel > Environment: openjpa 0.9.6 > Reporter: Gokhan Ergul > Attachments: test-case.zip > > > Both buildtime and runtime class enhancement fail with the following error: > ... > 1339 TRACE [main] openjpa.Enhance - Enhancing type "class test.B". > Exception in thread "main" <0|false|0.9.6-incubating> org.apache.openjpa.util.GeneralException: null > at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:350) > at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:3711) > at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:3661) > at org.apache.openjpa.enhance.PCEnhancer.main(PCEnhancer.java:3633) > Caused by: java.lang.NullPointerException > at org.apache.openjpa.enhance.PCEnhancer.enhanceObjectId(PCEnhancer.java:2745) > at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:338) > ... 3 more > Test code as follows: > test/A.java: > -------------- > package test; > import javax.persistence.*; > import java.io.Serializable; > @MappedSuperclass > abstract public class A { > @Embeddable > public static class A_PK implements Serializable { > @Basic > protected int id1; > > @Basic > protected String id2; > > public boolean equals (Object other) { > return false; > } > public int hashCode () { > return 0; > } > } > @EmbeddedId > protected A_PK pk; > @Basic > protected String val; > } > -------------- > test/B.java: > -------------- > package test; > import javax.persistence.Entity; > @Entity > public class B extends A { > } > -------------- > META-INF/persistence.xml: > -------------- > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" > version="1.0"> > > test.A$A_PK > test.A > test.B > > > > > > > > > > -------------- -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.