Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 839 invoked from network); 10 Apr 2009 23:22:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Apr 2009 23:22:37 -0000 Received: (qmail 98769 invoked by uid 500); 10 Apr 2009 23:22:36 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 98668 invoked by uid 500); 10 Apr 2009 23:22:36 -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 98648 invoked by uid 99); 10 Apr 2009 23:22:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Apr 2009 23:22:36 +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; Fri, 10 Apr 2009 23:22:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id CC460234C051 for ; Fri, 10 Apr 2009 16:22:14 -0700 (PDT) Message-ID: <1639776468.1239405734821.JavaMail.jira@brutus> Date: Fri, 10 Apr 2009 16:22:14 -0700 (PDT) From: "Fay Wang (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Resolved: (OPENJPA-1028) ClassCastException during findBy when embeddable is involved In-Reply-To: <721791085.1239141013112.JavaMail.jira@brutus> 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-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fay Wang resolved OPENJPA-1028. ------------------------------- Resolution: Fixed Fix Version/s: 2.0.0 > ClassCastException during findBy when embeddable is involved > ------------------------------------------------------------ > > Key: OPENJPA-1028 > URL: https://issues.apache.org/jira/browse/OPENJPA-1028 > Project: OpenJPA > Issue Type: Bug > Affects Versions: 2.0.0 > Reporter: Fay Wang > Assignee: Fay Wang > Fix For: 2.0.0 > > > Caused by: java.lang.ClassCastException: myFvt.EmbedA incompatible with myFvt.EntityA > at myFvt.EntityB.pcReplaceField(EntityB.java) > at org.apache.openjpa.kernel.StateManagerImpl.replaceField(StateManagerImpl.java:3083) > at org.apache.openjpa.kernel.StateManagerImpl.storeObjectField(StateManagerImpl.java:2512) > at org.apache.openjpa.kernel.StateManagerImpl.storeObject(StateManagerImpl.java:2502) > at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.setMappedBy(JDBCStoreManager.java:453) > at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:384) > at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:289) > at org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:111) > at org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57) > at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:995) > at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:953) > This ClassCastException occurred in the following test scenario: > (1) > @Entity > public class EntityA implements Serializable { > @Id > Integer id; > @Embedded > EmbedA embedA; > ... > } > (2) > @Embeddable > public class EmbedA { > > @OneToOne(mappedBy="a", fetch = FetchType.EAGER, cascade = CascadeType.ALL) > EntityB entityB; > > ... > } > (3) > @Entity > public class EntityB { > > @Id > protected int id; > @OneToOne > private EntityA a; > ... > } > (4) test case: > EntityManager em = emf.createEntityManager(); > EntityA a = em.find(EntityA.class, 1); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.