openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-2475) A query with LEFT FETCH JOIN returns incorrect results.
Date Tue, 18 Feb 2014 21:13:20 GMT

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

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

Commit 1569528 from [~jpaheath] 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.

> 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.1.5#6160)

Mime
View raw message