]
Strong Liu commented on HHH-5727:
---------------------------------
NOTE: currently, only fixed in org.hibernate.hql.ast.ASTQueryTranslatorFactory, but
org.hibernate.hql.classic.ClassicQueryTranslatorFactory
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: