[ 
https://issues.apache.org/jira/browse/OPENJPA-2475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13944311#comment-13944311
 ] 

ASF subversion and git services commented on OPENJPA-2475:
----------------------------------------------------------

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

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

> 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
>         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)

Reply via email to