OpenJPA
  1. OpenJPA
  2. OPENJPA-1184

Inverse relations not set for MapKey field when using parallel eager select

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 1.3.0, 2.0.0-M3
    • Component/s: jdbc
    • Labels:
      None
    • Environment:
      All environments using JDBC store.
    • Patch Info:
      Patch Available

      Description

      When selecting multiple entities A which contain a @MapKey field for entity B, the inverse relation from B to A will only be set for the first entity A, when using parallel eager select. This is because all entity B objects are created when loading the 1st entity A object, with the inverse relation to be set later in setInverseRelation(), but setInverseRelation() is looking for Collection fields only, so the Map fields are ignored.

      1. openjpa.patch
        0.8 kB
        David Minor
      2. mapkey-inverse-relation-test.patch
        7 kB
        David Minor

        Activity

        Hide
        David Minor added a comment -

        Patch against 1.2.1.

        Show
        David Minor added a comment - Patch against 1.2.1.
        Hide
        Donald Woods added a comment -

        David, do you have a junit testcase that demonstrates this failure?

        Show
        Donald Woods added a comment - David, do you have a junit testcase that demonstrates this failure?
        Hide
        David Minor added a comment -

        I don't – I've never written a test case for openjpa, so I'll see if I can find some time this next week to figure it out.

        Show
        David Minor added a comment - I don't – I've never written a test case for openjpa, so I'll see if I can find some time this next week to figure it out.
        Hide
        David Minor added a comment -

        Test case against 1.2.1 which demonstrates the issue.

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

        Patch and tests committed to trunk and 13x. Thanks to David Minor for the patches.

        Show
        Donald Woods added a comment - Patch and tests committed to trunk and 13x. Thanks to David Minor for the patches.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development