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

        David Minor created issue -
        Hide
        David Minor added a comment -

        Patch against 1.2.1.

        Show
        David Minor added a comment - Patch against 1.2.1.
        David Minor made changes -
        Field Original Value New Value
        Attachment openjpa.patch [ 12414015 ]
        Donald Woods made changes -
        Fix Version/s 1.2.2 [ 12313681 ]
        Fix Version/s 1.3.0 [ 12313326 ]
        Fix Version/s 2.0.0 [ 12314019 ]
        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.
        Donald Woods made changes -
        Assignee Donald Woods [ drwoods ]
        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.
        David Minor made changes -
        Attachment mapkey-inverse-relation-test.patch [ 12418200 ]
        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.
        Donald Woods made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.0-M3 [ 12314148 ]
        Fix Version/s 1.2.2 [ 12313681 ]
        Fix Version/s 2.0.0 [ 12314019 ]
        Resolution Fixed [ 1 ]
        Donald Woods made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        53d 4h 13m 1 Donald Woods 11/Sep/09 20:08
        Resolved Resolved Closed Closed
        178d 22h 22m 1 Donald Woods 09/Mar/10 18:31

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development