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

Map mapping error when use DataCache

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.0.0, 1.0.1, 1.0.2
    • 1.1.0
    • None
    • None
    • sunjdk 1.6.0_02

    Description

      As the following two Entity A and B, a.getBMap() throws
      Exception in thread "main" <openjpa-1.0.2-r420667:627158 fatal user error> org.apache.openjpa.persistence.ArgumentException: Could not locate metadata for the class using oid "key=mapbug.B-51" of type "class java.util.HashMap$Entry". Registered oid type mappings: "

      {class java.util.HashMap$Entry=null, class org.apache.openjpa.util.LongId=class mapbug.B}

      "

      when use DataCache
      ====================
      <property name="openjpa.DataCache" value="true"/>
      <property name="openjpa.RemoteCommitProvider" value="sjvm"/>
      ====================

      @Entity
      public class A {
      ...
      @OneToMany(mappedBy="a", cascade=CascadeType.ALL, fetch=FetchType.LAZY)
      @MapKey(name="key")
      Map<String, B> bMap;
      ...
      }

      @Entity
      public class B {
      ...
      @ManyToOne
      @JoinColumn(name="a_id")
      A a;

      @Column(name="ky")
      String key;
      String value;
      ...
      }

      Attachments

        1. mapbug.zip
          7 kB
          chenxiaohu

        Activity

          People

            Unassigned Unassigned
            xhchen chenxiaohu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: