HQL fails backward compatibility using classic translator

Description

with current HEAD the following statement fails:
hsession.createQuery("from StUserdaten as b where b.login = ?");

org.hibernate.HibernateException: ordinal parameter mismatch
at org.hibernate.engine.query.HQLQueryPlan.buildParameterMetadata(HQLQueryPlan.java:214)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:94)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:53)
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)

The query was build perfectly fine with hibernate 3.0.5 !

Environment

None

Activity

Show:
MathiasM
November 23, 2005, 3:38 PM

I'm getting

org.hibernate.HibernateException: ordinal parameter mismatch
at org.hibernate.engine.query.HQLQueryPlan.buildParameterMetadata(HQLQueryPlan.java:206)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:90)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:52)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:363)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:327)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1152)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:800)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:726)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1059)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory

with Hibernate 3.1 RC3.

Marc Lustig
November 23, 2005, 3:43 PM

can you post your query, I might have an idea.

Steve Ebersole
November 23, 2005, 5:35 PM

actually just realized this can be a problem if you are using the classic translator (i.e. not the antlr-based translator).

Steve Ebersole
November 23, 2005, 6:14 PM

fixed

Steve Ebersole
March 21, 2011, 6:58 PM

Closing stale resolved issues

Fixed

Assignee

Steve Ebersole

Reporter

Marc Lustig

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Critical
Configure