openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fay Wang (JIRA)" <>
Subject [jira] Created: (OPENJPA-1028) ClassCastException during findBy when embeddable is involved
Date Tue, 07 Apr 2009 21:50:13 GMT
ClassCastException during findBy when embeddable is involved

                 Key: OPENJPA-1028
             Project: OpenJPA
          Issue Type: Bug
    Affects Versions: 2.0.0
            Reporter: Fay Wang
            Assignee: Fay Wang

Caused by: java.lang.ClassCastException: myFvt.EmbedA incompatible with myFvt.EntityA
	at myFvt.EntityB.pcReplaceField(
	at org.apache.openjpa.kernel.StateManagerImpl.replaceField(
	at org.apache.openjpa.kernel.StateManagerImpl.storeObjectField(
	at org.apache.openjpa.kernel.StateManagerImpl.storeObject(
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.setMappedBy(
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(
	at org.apache.openjpa.kernel.DelegatingStoreManager.initialize(
	at org.apache.openjpa.kernel.ROPStoreManager.initialize(
	at org.apache.openjpa.kernel.BrokerImpl.initialize(
	at org.apache.openjpa.kernel.BrokerImpl.find(

This ClassCastException occurred in the following test scenario:

public class EntityA implements Serializable {
    Integer id;

    EmbedA embedA;


public class EmbedA {
    @OneToOne(mappedBy="a", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    EntityB entityB;

public class EntityB {
    protected int id;

    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.

View raw message