openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fay Wang (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENJPA-1256) get java.lang.ClassCastException when IdClass contains an Enum Field
Date Wed, 19 Aug 2009 21:05:16 GMT
get java.lang.ClassCastException when IdClass contains an Enum Field
--------------------------------------------------------------------

                 Key: OPENJPA-1256
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1256
             Project: OpenJPA
          Issue Type: Bug
          Components: kernel
    Affects Versions: 2.0.0
            Reporter: Fay Wang
             Fix For: 2.0.0


Suppose EntityA and EntityB are defined as follows:

@Entity
class EntityA {
   @Id
    int id;
  
   @OneToOne(fetch=fetchType=LAZE)
   EntityB entityB;
   
   ...
}

@Entity
@IdClass(BId.class)
class EntityB {

    @Id
    int intId;

   @Id
    BType bType;
...

    public enum BType { A1, A2, A3, A4 };
     ...
}


ClassCast Exception is thrown in the following situation:

    EntityA a = em.find(EntityA.class, 1)
    EntityB b = a.getEntityB();




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message