OpenJPA
  1. OpenJPA
  2. OPENJPA-1201

"Mapped by" field not set when contained in superclass

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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.

        Activity

        Hide
        David Minor added a comment -

        Patch against 1.2.1

        Show
        David Minor added a comment - Patch against 1.2.1
        Hide
        David Minor added a comment -

        Test case patch against 1.2.1 which demonstrates the issue.

        Show
        David Minor added a comment - Test case patch against 1.2.1 which demonstrates the issue.
        Hide
        Donald Woods added a comment -

        Committed to trunk as r814662.

        Show
        Donald Woods added a comment - Committed to trunk as r814662.
        Hide
        Donald Woods added a comment -

        Committed to 1.3.x as r814673.

        Show
        Donald Woods added a comment - Committed to 1.3.x as r814673.
        Hide
        Donald Woods added a comment -

        Mike/David, please reopen if you'd like to apply the patch to other branches.

        Show
        Donald Woods added a comment - Mike/David, please reopen if you'd like to apply the patch to other branches.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development