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

A query with LEFT FETCH JOIN returns incorrect results.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.1, 2.2.2, 2.2.1.1, 2.3.0, 2.4.0
    • Fix Version/s: 2.1.2, 2.2.1.1, 2.2.3, 2.4.0
    • Component/s: query
    • Labels:
      None

      Description

      Take the following two entities:

      @Entity
      public class DepartmentTest{
      @Id
      private String primaryKey;

      @OrderBy("name")
      @OneToMany(mappedBy = "departmentTest")
      private Set<PersonTest> persons = new HashSet<PersonTest>();
      ...........

      @Entity
      public class PersonTest {
      @Id
      private String primaryKey;

      @ManyToOne
      @ForeignKey
      private DepartmentTest departmentTest;

      private String name;
      .....

      With these entities, take this JPQL:

      "SELECT DISTINCT dept FROM DepartmentTest dept LEFT JOIN FETCH dept.persons";

      Depending on the data in the database (the order is important, see the provided test), this query can return a results set where some of the 'persons' are missing.

      Thanks,

      Heath Thomann

        Activity

        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1569528 from Heath Thomann in branch 'openjpa/branches/2.1.x'
        [ https://svn.apache.org/r1569528 ]

        OPENJPA-2475: A query with LEFT FETCH JOIN returns incorrect results - applied fix to 2.1.x.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1569528 from Heath Thomann in branch 'openjpa/branches/2.1.x' [ https://svn.apache.org/r1569528 ] OPENJPA-2475 : A query with LEFT FETCH JOIN returns incorrect results - applied fix to 2.1.x.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1575444 from Heath Thomann in branch 'openjpa/branches/2.1.x'
        [ https://svn.apache.org/r1575444 ]

        OPENJPA-2475: A query with LEFT FETCH JOIN returns incorrect results - made test update.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1575444 from Heath Thomann in branch 'openjpa/branches/2.1.x' [ https://svn.apache.org/r1575444 ] OPENJPA-2475 : A query with LEFT FETCH JOIN returns incorrect results - made test update.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1575445 from Heath Thomann in branch 'openjpa/branches/1.2.x'
        [ https://svn.apache.org/r1575445 ]

        OPENJPA-2475: A query with LEFT FETCH JOIN returns incorrect results - applied changes to 1.2.x.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1575445 from Heath Thomann in branch 'openjpa/branches/1.2.x' [ https://svn.apache.org/r1575445 ] OPENJPA-2475 : A query with LEFT FETCH JOIN returns incorrect results - applied changes to 1.2.x.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1576519 from Heath Thomann in branch 'openjpa/branches/2.0.x'
        [ https://svn.apache.org/r1576519 ]

        OPENJPA-2475: A query with LEFT FETCH JOIN returns incorrect results - merged changes to 2.0.x.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1576519 from Heath Thomann in branch 'openjpa/branches/2.0.x' [ https://svn.apache.org/r1576519 ] OPENJPA-2475 : A query with LEFT FETCH JOIN returns incorrect results - merged changes to 2.0.x.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1580429 from Heath Thomann in branch 'openjpa/branches/2.2.1.x'
        [ https://svn.apache.org/r1580429 ]

        OPENJPA-2475: A query with LEFT FETCH JOIN returns incorrect results - applied fix to 2.2.1.x

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1580429 from Heath Thomann in branch 'openjpa/branches/2.2.1.x' [ https://svn.apache.org/r1580429 ] OPENJPA-2475 : A query with LEFT FETCH JOIN returns incorrect results - applied fix to 2.2.1.x
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1580430 from Heath Thomann in branch 'openjpa/branches/2.2.x'
        [ https://svn.apache.org/r1580430 ]

        OPENJPA-2475: A query with LEFT FETCH JOIN returns incorrect results - applied fix to 2.2.x

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1580430 from Heath Thomann in branch 'openjpa/branches/2.2.x' [ https://svn.apache.org/r1580430 ] OPENJPA-2475 : A query with LEFT FETCH JOIN returns incorrect results - applied fix to 2.2.x
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1580431 from Heath Thomann in branch 'openjpa/branches/2.3.x'
        [ https://svn.apache.org/r1580431 ]

        OPENJPA-2475: A query with LEFT FETCH JOIN returns incorrect results - applied fix to 2.3.x

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1580431 from Heath Thomann in branch 'openjpa/branches/2.3.x' [ https://svn.apache.org/r1580431 ] OPENJPA-2475 : A query with LEFT FETCH JOIN returns incorrect results - applied fix to 2.3.x
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1580432 from Heath Thomann in branch 'openjpa/trunk'
        [ https://svn.apache.org/r1580432 ]

        OPENJPA-2475: A query with LEFT FETCH JOIN returns incorrect results - applied fix to trunk.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1580432 from Heath Thomann in branch 'openjpa/trunk' [ https://svn.apache.org/r1580432 ] OPENJPA-2475 : A query with LEFT FETCH JOIN returns incorrect results - applied fix to trunk.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1595308 from Jody Grassel in branch 'openjpa/branches/2.2.x'
        [ https://svn.apache.org/r1595308 ]

        OPENJPA-2475: A query with LEFT FETCH JOIN returns incorrect results

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1595308 from Jody Grassel in branch 'openjpa/branches/2.2.x' [ https://svn.apache.org/r1595308 ] OPENJPA-2475 : A query with LEFT FETCH JOIN returns incorrect results

          People

          • Assignee:
            jpaheath Heath Thomann
            Reporter:
            jpaheath Heath Thomann
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development