Hi All,
I am doing my application with Hibernate, Spring and Trinidad. I am
using <prop
key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop>
property in my spring-context.xml file {Spring Configuration file} For
Hibernate Query to work with Trinidad. The other factory class property
<prop
key="hibernate.query.factory_class">org.hibernate.hql.ast.ASTQueryTranslatorFactory</prop>
is not working with view Layer [Trinidad].
My question is.... When ever I am having a HQL with case when...else...end
condition. The query is working fine upto Spring Layer. But In view Layer
with Trinidad, I am getting following error.
org.hibernate.QueryException: undefined alias: CASE [SELECT CASE WHEN x.ID
IS NULL THEN x.name ELSE x.desc END FROM X x
at
org.hibernate.hql.classic.PathExpressionParser.token(PathExpressionParser.java:130)
at org.hibernate.hql.classic.ParserHelper.parse(ParserHelper.java:28)
at org.hibernate.hql.classic.SelectParser.token(SelectParser.java:176)
at org.hibernate.hql.classic.ClauseParser.token(ClauseParser.java:86)
at org.hibernate.hql.classic.ClauseParser.end(ClauseParser.java:113)
at
org.hibernate.hql.classic.PreprocessingParser.end(PreprocessingParser.java:122)
at org.hibernate.hql.classic.ParserHelper.parse(ParserHelper.java:29)
at
org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:216)
at
org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:185)
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)
at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.orm.hibernate3.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1192)
at $Proxy1.createQuery(Unknown Source)
Can AnyOne please look into the problem? and suggest some idea.
Thanks,
Bandaru
--
View this message in context:
http://www.nabble.com/Getting-Error-While-retreiving-Hibernate-Query-Result-in-View-Layer-Using-Trinidad-tf4607702.html#a13157312
Sent from the MyFaces - Users mailing list archive at Nabble.com.