Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 8972 invoked from network); 21 Aug 2008 10:03:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Aug 2008 10:03:28 -0000 Received: (qmail 11114 invoked by uid 500); 21 Aug 2008 10:03:20 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 10988 invoked by uid 500); 21 Aug 2008 10:03:20 -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 10944 invoked by uid 99); 21 Aug 2008 10:03:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Aug 2008 03:03:20 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [147.91.1.120] (HELO afrodita.rcub.bg.ac.yu) (147.91.1.120) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Aug 2008 10:02:22 +0000 Received: from [147.91.4.66] (ognjen-pc.rcub.bg.ac.yu [147.91.4.66]) by afrodita.rcub.bg.ac.yu (Postfix) with ESMTP id 6249C19198B9 for ; Thu, 21 Aug 2008 12:02:12 +0200 (CEST) Message-ID: <48AD3BAC.9090606@etf.bg.ac.yu> Date: Thu, 21 Aug 2008 11:55:56 +0200 From: Ognjen Blagojevic User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: dev@openjpa.apache.org Subject: Re: Selecting multiple objects - bug? References: <48AAB020.5070303@etf.bg.ac.yu> In-Reply-To: <48AAB020.5070303@etf.bg.ac.yu> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-RCUB-MailScanner-Information: Please contact the ISP for more information X-RCUB-MailScanner: Found to be clean X-Virus-Checked: Checked by ClamAV on apache.org According to JPA spec, this seems to be bug: "4.8.1 Result Type of the SELECT Clause" states: "The type of the query result specified by the SELECT clause of a query is an entity abstract schema type, a state-field type, the result of an aggregate function, the result of a construction operation, or some sequence of these." Since "m, p" in the given query represents "some sequence of" entities, it should be allowed. Could anyone, please, confirm that this is erratic behavior before I raise u bug in JIRA? Regards, Ognjen Ognjen Blagojevic wrote: > Hi, > > When I try to select multiple objects in a query like this one > (publisher of the magazine can be null - unknown): > > SELECT m, p > FROM Magazine m > LEFT OUTER JOIN m.idPublisher p > WHERE ((:useName = false) OR (p.name like :name)) > > I would expect to get the resultset of pairs (Magazine, Publisher), but > what OpenJPA 1.1.0 returns is resultset of pairs (Publisher, Publisher). > > Did anyone else noticed this behavior, and should I file a bug report? > > Is it allowed in JPA spec to select multiple objects? > > > Regards, > Ognjen > > ps. I know I could select just Magazine, and then get Publisher from > there. The actual query is more complex, this one is just for the > purpose of showing the bug. >