Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1256

get java.lang.ClassCastException when IdClass contains an Enum Field

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M2
    • Fix Version/s: 2.0.0-M3
    • Component/s: kernel
    • Labels:
      None

      Description

      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();

        Attachments

          Activity

            People

            • Assignee:
              faywang Fay Wang
              Reporter:
              faywang Fay Wang
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: