[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-5727) Collection member declaration not handling optional AS in HQL.

Strong Liu (JIRA) noreply at atlassian.com
Mon Dec 13 15:55:13 EST 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5727?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Strong Liu resolved HHH-5727.
-----------------------------

    Resolution: Fixed

> Collection member declaration not handling optional AS in HQL.
> --------------------------------------------------------------
>
>                 Key: HHH-5727
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5727
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.4.sp1, 3.3.2
>            Reporter: Dave Stephan
>            Assignee: Strong Liu
>             Fix For: 3.6.1, 4.0.0.Alpha1
>
>
> HQL:
> SELECT o FROM EntityBean AS o, IN (o.items) AS l WHERE l.itemValue = '1'
> The log output gives the following:
> 2010-11-10 16:03:53,286 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] (WorkerThread#0[127.0.0.1:60518]) parse() - HQL: SELECT o FROM EntityBean AS o, IN (o.items) AS l WHERE l.itemValue = '1'
> 2010-11-10 16:03:53,290 DEBUG [org.hibernate.hql.PARSER] (WorkerThread#0[127.0.0.1:60518]) Keyword  'AS' is being interpreted as an identifier due to: expecting IDENT, found 'AS'
> 2010-11-10 16:03:53,403 ERROR [org.hibernate.hql.PARSER] (WorkerThread#0[127.0.0.1:60518]) line 1:48: unexpected token: l
> According to the jpa persistence spec the AS keyword is optional for collection declarations:
> collection_member_declaration ::=
> IN (collection_valued_path_expression) [AS] identification_variable
> In hql.g we have:
> inCollectionDeclaration!
>    : IN! OPEN! p:path CLOSE! a:alias
>      { #inCollectionDeclaration = #([JOIN, "join"], [INNER, "inner"], #p, #a); }
>    ;
> Should this be a:asAlias rather than a:alias?
> Workaround: Do not use option AS, only identifier in the HQL for collection.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list