[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1247?page=c...
]
Steve Ebersole closed HHH-1247.
-------------------------------
Closing stale resolved issues
HQL doesn't allow '$' as the leading character for
property names
-----------------------------------------------------------------
Key: HHH-1247
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1247
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.1 rc3
Environment: Hibernate 3.1-rc3; Windows; JDK1.5.0; SQLSerer2ksp4
Reporter: Dean Arnold
Assignee: Joshua Davis
HQL Query example:
select distinct user.party from com.itf.iceclaims.domain.party.user.UserImpl user inner
join user.party.$RelatedWorkgroups relatedWorkgroups where relatedWorkgroups.workgroup.id
= :workgroup and relatedWorkgroups.effectiveTime.start <= :datesnow and
relatedWorkgroups.effectiveTime.end > :dateenow
Stack Trace:
Caused by: org.hibernate.QueryException: unexpected char: '$' [select distinct
user.party from com.itf.iceclaims.domain.party.user.UserImpl user inner join
user.party.$RelatedWorkgroups relatedWorkgroups where relatedWorkgroups.workgroup.id =
:workgroup and relatedWorkgroups.effectiveTime.start <= :datesnow and
relatedWorkgroups.effectiveTime.end > :dateenow]
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:190)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:103)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:72)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:52)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:108)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at
org.springframework.orm.hibernate3.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1178)
at $Proxy195.createQuery(Unknown Source)
at
com.itf.iceclaims.dao.party.user.UserDaoHibernateImpl$2.doInHibernate(UserDaoHibernateImpl.java:85)
at
org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:365)
... 55 more
Caused by: line 1:105: unexpected char: '$'
at org.hibernate.hql.antlr.HqlBaseLexer.nextToken(HqlBaseLexer.java:278)
at antlr.TokenBuffer.fill(TokenBuffer.java:69)
at antlr.TokenBuffer.LA(TokenBuffer.java:80)
at antlr.LLkParser.LA(LLkParser.java:52)
at org.hibernate.hql.ast.HqlParser.weakKeywords(HqlParser.java:281)
at org.hibernate.hql.antlr.HqlBaseParser.path(HqlBaseParser.java:542)
at org.hibernate.hql.antlr.HqlBaseParser.fromJoin(HqlBaseParser.java:1705)
at org.hibernate.hql.antlr.HqlBaseParser.fromClause(HqlBaseParser.java:1420)
at org.hibernate.hql.antlr.HqlBaseParser.selectFrom(HqlBaseParser.java:1130)
at org.hibernate.hql.antlr.HqlBaseParser.queryRule(HqlBaseParser.java:702)
at org.hibernate.hql.antlr.HqlBaseParser.selectStatement(HqlBaseParser.java:296)
at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:159)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:236)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:153)
... 69 more
Propsed/Working Solution:
Update the 'hql.g' grammer file, lines 780 to 792, with the following code
fragment. (I have moved the '$' character from the ID_LETTER to the
ID_START_LETTER):
protected
ID_START_LETTER
: '_'
| 'a'..'z'
| '\u0080'..'\ufffe' // HHH-558 : Allow unicode chars in
identifiers
| '$'
;
protected
ID_LETTER
: ID_START_LETTER
| '0'..'9'
;
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira