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

"Mapped by" field not set when contained in superclass

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.0, 1.2.1
    • 1.3.0, 2.0.0-M3
    • jdbc
    • None
    • Patch Available

    Description

      The mapped by field (inverse relation) is not set when the field is contained in a superclass. In my case the problem was with a collection of objects of the same type (i.e. a hierarchy), and using parallel eager fetch mode, but I think the problem may be more general.

      I tracked the problem to the setMappedBy() method in JDBCStoreManager, which is calling getDeclaredFieldMappings(), but the result of this call doesn't include superclass field mappings. Changing it to getFieldMappings() fixed the problem.

      Attachments

        1. openjpa_superclass_collection.patch
          0.8 kB
          David Minor
        2. test-abstract-class-inverse-relation.patch
          8 kB
          David Minor

        Activity

          People

            drwoods Donald Woods
            david minor David Minor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: