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

Dave Stephan (JIRA) noreply at atlassian.com
Wed Nov 10 18:17:13 EST 2010


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.3.2, 3.2.4.sp1
            Reporter: Dave Stephan


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?

-- 
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