Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F2E35114B6 for ; Fri, 16 May 2014 21:04:46 +0000 (UTC) Received: (qmail 31107 invoked by uid 500); 16 May 2014 19:49:53 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 83956 invoked by uid 500); 16 May 2014 19:24:55 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 28630 invoked by uid 99); 16 May 2014 19:08:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 May 2014 19:08:16 +0000 Date: Fri, 16 May 2014 19:08:16 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: dev@openjpa.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (OPENJPA-2475) A query with LEFT FETCH JOIN returns incorrect results. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-2475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14000155#comment-14000155 ] ASF subversion and git services commented on OPENJPA-2475: ---------------------------------------------------------- Commit 1595308 from [~fyrewyld] in branch 'openjpa/branches/2.2.x' [ https://svn.apache.org/r1595308 ] OPENJPA-2475: A query with LEFT FETCH JOIN returns incorrect results > 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 persons = new HashSet(); > ........... > @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)