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

"Mapped by" field not set when contained in superclass

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0, 1.2.1
    • Fix Version/s: 1.3.0, 2.0.0-M3
    • Component/s: jdbc
    • Labels:
      None
    • Patch Info:
      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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: