You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Milosz Tylenda (JIRA)" <ji...@apache.org> on 2011/03/19 20:40:29 UTC

[jira] Resolved: (OPENJPA-478) Contradictory text in manual section 10.2.6. JPQL GROUP BY, HAVING

     [ https://issues.apache.org/jira/browse/OPENJPA-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Milosz Tylenda resolved OPENJPA-478.
------------------------------------

    Resolution: Fixed

OpenJPA supports HAVING without GROUP BY and assumes the database also allows such a construct. The manual is updated.

> 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
>    Affects Versions: 1.2.2, 2.1.0
>         Environment: linux, firefox, etc..
>            Reporter: Andy Schlaikjer
>            Assignee: Milosz Tylenda
>            Priority: Minor
>             Fix For: 2.2.0
>
>
> 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 aggregate 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 otherwise.
> Looking at section 10.2.12 JPQL BNF (http://openjpa.apache.org/docs/latest/manual/jpa_langref.html#jpa_langref_bnf), it seems as though the BNF contradicts the last sentence:
> """
> select_statement ::= select_clause from_clause [where_clause] [groupby_clause] [having_clause] [orderby_clause]
> """
> otherwise the BNF would be something like this:
> select_statement ::= select_clause from_clause [where_clause] [groupby_clause [having_clause]] [orderby_clause]

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira