[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2840) Externalizing named HQL queries with DML is impossible

Dimitri Lubenskyy (JIRA) noreply at atlassian.com
Thu Sep 13 07:42:14 EDT 2007


Externalizing named HQL queries with DML is impossible
------------------------------------------------------

                 Key: HHH-2840
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2840
             Project: Hibernate3
          Issue Type: Bug
         Environment: Hibernate Core 3.2.5
            Reporter: Dimitri Lubenskyy


Externalizing the update HQL query into the XML file e.g.

....
</class>
<query name="hqlResetNotificationDatePlc">
    <![CDATA[update ServiceEvents se set se.notificationNeeded=0 where se.notificationNeeded=1]]>
</query>    
</hibernate-mapping>

Throws the exception:

org.hibernate.hql.ast.ErrorCounter: line 1:1: unexpected token: hqlResetNotificationDateRc
line 1:1: unexpected token: hqlResetNotificationDateRc
	at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:171)
	at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:248)
	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>(HQLQueryPlan.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)

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