Return-Path: X-Original-To: apmail-openjpa-users-archive@minotaur.apache.org Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C7F8F10878 for ; Tue, 17 Mar 2015 22:56:16 +0000 (UTC) Received: (qmail 68056 invoked by uid 500); 17 Mar 2015 22:56:16 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 68015 invoked by uid 500); 17 Mar 2015 22:56:16 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 68004 invoked by uid 99); 17 Mar 2015 22:56:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Mar 2015 22:56:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sia_far@hotmail.com designates 65.55.34.152 as permitted sender) Received: from [65.55.34.152] (HELO COL004-OMC3S14.hotmail.com) (65.55.34.152) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Mar 2015 22:56:10 +0000 Received: from COL131-W45 ([65.55.34.136]) by COL004-OMC3S14.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Tue, 17 Mar 2015 15:55:07 -0700 X-TMN: [wUXZaKP1Xs8SCPTkYem7L9tgA4vlVODL] X-Originating-Email: [sia_far@hotmail.com] Message-ID: From: sia To: "users@openjpa.apache.org" Subject: Forcing an outer join in many-to-one relations with order by column Date: Tue, 17 Mar 2015 22:55:07 +0000 Importance: Normal Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 17 Mar 2015 22:55:07.0603 (UTC) FILETIME=[6A11DA30:01D06105] X-Virus-Checked: Checked by ClamAV on apache.org Hello All:=0A= =0A= I was wondering if someone can help me with this issue. I have been reading= /searching the forum with no avail as well all over the web. I have an enti= ty as follows:=0A= =0A= @Entity=0A= @Table(name =3D "REQUEST")=0A= public class Request {=0A= =0A= @ManyToOne(fetch =3D FetchType.EAGER)=0A= =A0=A0=A0 @JoinColumn(name =3D "SLOT_ID"=2C referencedColumnName =3D "SLOT_= ID")=0A= =A0=A0=A0 private Asset slot=3B=0A= =0A= .....=0A= }=0A= =0A= Running the following query cause a left outer join with my relation : =0A= =0A= Select r from Request r=3B=0A= =0A= However=3B if I run=0A= =0A= Select r from Request r ORDER BY r.slot.name=0A= =0A= this would generate an inner join.=0A= =0A= I would like to force an outer join at all times at the entity level. I hav= e looked into writing a custom strategy by extending RelationFieldStrategy= =3B however=2C I see only addFetchInnerJoin in JDBCFetchConfiguration class= when I try to override=0A= =0A= public void selectEagerJoin(Select sel=2C OpenJPAStateManager sm=2C=0A= =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 JDB= CStore store=2C JDBCFetchConfiguration fetch=2C int eagerMode)=0A= =0A= Can someone kindly give me a hint if this is possible or I have to extend a= different class or some how set the fetch mode to OUTER JOIN in my entity.= =0A= =