openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Heath Thomann (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (OPENJPA-2475) A query with LEFT FETCH JOIN returns incorrect results.
Date Mon, 05 May 2014 17:54:15 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-2475?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Heath Thomann closed OPENJPA-2475.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.4.0
                   2.3.1
                   2.2.3
                   2.2.1.1
                   2.1.2

> A query with LEFT FETCH JOIN returns incorrect results.
> -------------------------------------------------------
>
>                 Key: OPENJPA-2475
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2475
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>    Affects Versions: 2.1.1, 2.2.2, 2.2.1.1, 2.3.0, 2.4.0
>            Reporter: Heath Thomann
>            Assignee: Heath Thomann
>            Priority: Minor
>             Fix For: 2.1.2, 2.2.1.1, 2.2.3, 2.3.1, 2.4.0
>
>         Attachments: OPENJPA-2475-2.1.x.test
>
>
> 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



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message