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 284B010487 for ; Sun, 23 Mar 2014 02:36:44 +0000 (UTC) Received: (qmail 63096 invoked by uid 500); 23 Mar 2014 02:36:43 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 63039 invoked by uid 500); 23 Mar 2014 02:36:43 -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 63026 invoked by uid 99); 23 Mar 2014 02:36:42 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Mar 2014 02:36:42 +0000 Date: Sun, 23 Mar 2014 02:36:42 +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=13944307#comment-13944307 ] ASF subversion and git services commented on OPENJPA-2475: ---------------------------------------------------------- Commit 1580430 from [~jpaheath] 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 > 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 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)