Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 39304 invoked from network); 15 Mar 2010 11:39:37 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 15 Mar 2010 11:39:37 -0000 Received: (qmail 37721 invoked by uid 500); 15 Mar 2010 11:38:51 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 37675 invoked by uid 500); 15 Mar 2010 11:38:50 -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 37667 invoked by uid 99); 15 Mar 2010 11:38:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Mar 2010 11:38:50 +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, 15 Mar 2010 11:38:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4C707234C1EF for ; Mon, 15 Mar 2010 11:38:27 +0000 (UTC) Message-ID: <460798012.263941268653107311.JavaMail.jira@brutus.apache.org> Date: Mon, 15 Mar 2010 11:38:27 +0000 (UTC) From: "Oliver Ringel (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-1570) Exception using @Strategy in @MappedSuperclass or @Embeddable classes In-Reply-To: <673345903.245171268489607252.JavaMail.jira@brutus.apache.org> 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 [ https://issues.apache.org/jira/browse/OPENJPA-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12845279#action_12845279 ] Oliver Ringel commented on OPENJPA-1570: ---------------------------------------- I not sure if you mean me with Charles, but I switched to the latest snapshot release from the apache snapshot repository and tested the attached test case and my project with the snapshot. Also I tested @Strategy with some combinations of @MappedSuperclass and @Embeddable. @Strategy is working as expected now. Thanks very much for the quick help. > Exception using @Strategy in @MappedSuperclass or @Embeddable classes > --------------------------------------------------------------------- > > Key: OPENJPA-1570 > URL: https://issues.apache.org/jira/browse/OPENJPA-1570 > Project: OpenJPA > Issue Type: Bug > Affects Versions: 2.0.0-beta2 > Environment: Ubuntu 9.10, Maven 2.2.1, Spring 3.0.1 > Reporter: Oliver Ringel > Attachments: openjpa1570.tar > > > An exception occurs if you add the @Strategy annotation on a field of an @Embeddable or @MappedSuperclass (not part of an @ElementCollection). > The patch OPENJPA-1556.patch does not fix the problem. > org.apache.openjpa.persistence.ArgumentException: Attempt to map "jpa.test.domain.TestEntityBase.testEnumSimple" failed: the owning entity is not mapped. > To be more concrete. I try to change the default enum handling using an own EnumValueHandler. The Handler is working if you add > the @Strategy to the @Entity. Adding @Strategy on a field in a @MappedSuperclass leads to the above exception. > @javax.persistence.Entity > @javax.persistence.Table(name = "TESTENTITY") > public class TestEntity extends TestEntityBase { > ... > } > @MappedSuperclass > public abstract class TestEntityBase { > @Column(name = "TESTENUMSIMPLE") > @Enumerated(javax.persistence.EnumType.STRING) > @Strategy("jpa.test.domain.EnumStrategy") > private TestEnumSimple testEnumSimple; > ... > } > You get the same Exception if you add the @Strategy to a @Embeddable and I also tried a own simple StringValueHandler with the same result. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.