Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 22734 invoked from network); 8 Jun 2008 08:02:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jun 2008 08:02:09 -0000 Received: (qmail 80533 invoked by uid 500); 8 Jun 2008 08:02:12 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 80508 invoked by uid 500); 8 Jun 2008 08:02:12 -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 80497 invoked by uid 99); 8 Jun 2008 08:02:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jun 2008 01:02:12 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jun 2008 08:01:31 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6B27C234C143 for ; Sun, 8 Jun 2008 01:01:48 -0700 (PDT) Message-ID: <693223022.1212912108437.JavaMail.jira@brutus> Date: Sun, 8 Jun 2008 01:01:48 -0700 (PDT) From: "Milosz Tylenda (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-478) contradictory text in manual section 10.2.6. JPQL GROUP BY, HAVING In-Reply-To: <4056245.1199809533860.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-478?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D126= 03354#action_12603354 ]=20 Milosz Tylenda commented on OPENJPA-478: ---------------------------------------- The JPA spec says: "If there is no GROUP BY clause and the HAVING clause is used, the result i= s treated as a single group, and the select list can only consist of aggregate functions. The use of HAV= ING in the absence of GROUP BY is not required to be supported by an implementation of this speci= =EF=AC=81cation. Portable appli- cations should not rely on HAVING without the use of GROUP BY." If OpenJPA does not allow HAVING without GROUP BY, the paragraph in questio= n could be changed to something like: "OpenJPA requires that if a query declares a HAVING clause, it must also de= clare a GROUP BY clause." > contradictory text in manual section 10.2.6. JPQL GROUP BY, HAVING > ------------------------------------------------------------------ > > Key: OPENJPA-478 > URL: https://issues.apache.org/jira/browse/OPENJPA-478 > Project: OpenJPA > Issue Type: Bug > Components: docs > Environment: linux, firefox, etc.. > Reporter: Andy Schlaikjer > > In section 10.2.6. JPQL GROUP BY, HAVING (http://openjpa.apache.org/docs/= latest/manual/jpa_langref.html#jpa_langref_group) the last paragraph seems = contradictory: > """ > If there is no GROUP BY clause and the HAVING clause is used, the result= is treated as a single group, and the select list can only consist of aggr= egate functions. When a query declares a HAVING clause, it must always also= declare a GROUP BY clause. > """ > The first sentences seems to imply that a query may incorporate a HAVING = clause without a GROUP BY clause, but the second sentence indicates otherwi= se. > Looking at section 10.2.12 JPQL BNF (http://openjpa.apache.org/docs/lates= t/manual/jpa_langref.html#jpa_langref_bnf), it seems as though the BNF cont= radicts the last sentence: > """ > select_statement ::=3D select_clause from_clause [where_clause] [groupby_= clause] [having_clause] [orderby_clause] > """ > otherwise the BNF would be something like this: > select_statement ::=3D select_clause from_clause [where_clause] [groupby_= clause [having_clause]] [orderby_clause] --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.