[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2918) org.hibernate.hql.ast.QuerySyntaxException on entity named Group

Viorel Andronic (JIRA) noreply at atlassian.com
Mon Oct 29 10:34:38 EDT 2007


 org.hibernate.hql.ast.QuerySyntaxException on entity named Group
-----------------------------------------------------------------

                 Key: HHH-2918
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2918
             Project: Hibernate3
          Issue Type: Bug
          Components: query-hql
            Reporter: Viorel Andronic


I don't know exactly who is the responsible for this: hibernate.hql or javax.el but when I use a entity named Group and a query like 

select group from klaw.entity.security.Group group where lower(group.name) like concat(lower(:el1),'%')

I get a big stack trace that contains the following information, in sequence

16:21:01,968 INFO  [STDOUT] Hibernate: select group0_.id as id0_, group0_.name as name0_ from security.group group0_ limit ?
16:21:02,015 ERROR [PARSER] line 1:64: unexpected token: group
16:21:02,031 WARN  [lifecycle] javax.el.ELException: /GroupList.xhtml @41,58 rendered="#{empty groupList.resultList}": Error reading 'resultList' on type klaw.entity.security.GroupList_$$_javassist_37
16:21:02,312 ERROR [PARSER] line 1:64: unexpected token: group
16:21:02,328 ERROR [STDERR] Oct 29, 2007 4:21:02 PM com.sun.facelets.FaceletViewHandler handleRenderException
SEVERE: Error Rendering View[/GroupList.xhtml]
javax.faces.FacesException: javax.el.ELException: /GroupList.xhtml @41,58 rendered="#{empty groupList.resultList}": Error reading 'resultList' on type klaw.entity.security.GroupList_$$_javassist_37
	at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:373)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:880)
...
Caused by: javax.el.ELException: /GroupList.xhtml @41,58 rendered="#{empty groupList.resultList}": Error reading 'resultList' on type klaw.entity.security.GroupList_$$_javassist_37
	at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
	at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:370)
	... 44 more
Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: group near line 1, column 64 [select group from klaw.entity.security.Group group where lower(group.name) like concat(lower(:el1),'%')]
	at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:616)
	at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:95)
...
Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: group near line 1, column 64 [select group from klaw.entity.security.Group group where lower(group.name) like concat(lower(:el1),'%')]
	at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
	at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
	at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
	at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:258)
	at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
	at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
	at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPla
16:21:02,328 ERROR [STDERR] n.java:77)
	at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
	at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
        at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
	at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
	at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
	at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:92)
	... 76 more
16:21:02,343 ERROR [PARSER] line 1:64: unexpected token: group
16:21:02,343 ERROR [PARSER] line 1:64: unexpected token: group
16:21:02,359 ERROR [PARSER] line 1:64: unexpected token: group
16:21:02,375 ERROR [PARSER] line 1:64: unexpected token: group
16:21:02,375 ERROR [PARSER] line 1:64: unexpected token: group
16:21:02,375 ERROR [PARSER] line 1:67: unexpected token: group


I managed to avoid this by changing the query to

select grp from klaw.entity.security.Group grp where lower(grp .name) like concat(lower(:el1),'%')

The content of the el1 is the following: #{groupList.group.name} and I didn't change it for the running version of the hql


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