-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Error retreiving Hibernate Query Result in View [Trinidad]
PostPosted: Wed Oct 03, 2007 9:14 am 
Regular
Regular

Joined: Mon Apr 02, 2007 3:54 am
Posts: 67
Location: Hyderabad
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)
org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:362)
at org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:332)
at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:154)
at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:145)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:208)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:165)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:622)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:369)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:865)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:447)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:215)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:619)


Can AnyOne please look into the problem, and suggest some idea.

Thanks,
Gopal


Last edited by gopal.knoah on Thu Oct 11, 2007 10:36 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 04, 2007 5:08 am 
Regular
Regular

Joined: Mon Apr 02, 2007 3:54 am
Posts: 67
Location: Hyderabad
Can AnyOne please look into the problem and give me some suggestion about how to resolve this ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 05, 2007 3:34 am 
Regular
Regular

Joined: Mon Apr 02, 2007 3:54 am
Posts: 67
Location: Hyderabad
Can AnyOne tell me that what may be a reason that a hql with select case condition is not running in view Layer with Trinidad and JSF.

Thanks,
Gopal


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 05, 2007 4:59 am 
Regular
Regular

Joined: Sun Sep 30, 2007 7:51 pm
Posts: 93
Hm. Can you provide the log from hibernate with show_sql=true, to see what hibernate generates?

Pavol


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 08, 2007 4:45 am 
Regular
Regular

Joined: Mon Apr 02, 2007 3:54 am
Posts: 67
Location: Hyderabad
pavol.zibrita wrote:
Hm. Can you provide the log from hibernate with show_sql=true, to see what hibernate generates?

Pavol


Hi Pavol,

I already made show_sql="true". Given is the same log. I am not getting converted sql. Can u suggest some idea ?

Thanks,
Gopal


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 08, 2007 5:04 am 
Regular
Regular

Joined: Sun Sep 30, 2007 7:51 pm
Posts: 93
Hm. Why the other translator factory is not working? Is there some exception? Because this seems that the classic translator factory cannot translate the case query.

Pavol


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.