[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4613) HQL: QuerySyntaxException when parsing any condition containing a colum named "value"

Guenther Demetz (JIRA) noreply at atlassian.com
Fri Nov 27 05:39:09 EST 2009


HQL: QuerySyntaxException when parsing any condition containing a colum named "value"
-------------------------------------------------------------------------------------

                 Key: HHH-4613
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4613
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.5.0-Beta-2
         Environment: 3.5.0-Beta2, Db: HSQLDB
            Reporter: Guenther Demetz
            Priority: Minor
         Attachments: TestCaseQueryWithCondition.jar

org.hibernate.hql.ast.QuerySyntaxException: expecting OPEN, found '=' near line 1, column 27

is thrown calling

((org.hibernate.Session) session).createQuery("from hello.A  where value = ?"); 

Please note that until Hibernate3.3.2GA this worked fine!

Apparently 'value' unintentionally has become a reserved keyword for HQL conditions.

Here the complete stacktrace:

 --> org.hibernate.hql.ast.QuerySyntaxException: expecting OPEN, found '=' near line 1, column 27 [from hello.A  where value = ?]
        at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54)
        at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47)
        at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82)
        at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:284)
        at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:182)
        at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
        at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
        at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
        at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94)
        at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
        at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
        at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1586)
        at hello.TestQueryWithCondition.testQuery(TestQueryWithCondition.java:40)


Please consider attached junit-testcase.

best regards
Guenther Demetz
   

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