-->
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.  [ 2 posts ] 
Author Message
 Post subject: In clause
PostPosted: Thu Nov 20, 2003 7:18 am 
Beginner
Beginner

Joined: Thu Sep 25, 2003 10:30 am
Posts: 23
Location: india
Hi,
I am using hibernate for quite a sometime now. I been working on this query for past couple of days

I am using 2 "IN" clause in the where condition of query. I have oracle as backend server.

I think that this isn't allowed or what?
My query is

Query query=session.createQuery("from BasicPolicyDetails basic where basic.product.id in (:productid) and basic.agentType.id=:agentTypeid and basic.coInsurerOption=:coInsurerOption and basic.location.id in (:locationcodeid)");



It gives me error something like this.

16:42:28,700 ERROR [STDERR] net.sf.hibernate.QueryException: Named parameter doe
s not appear in Query: productid0_ [from com.webify.ccpa.db.Policy.BasicPolicyDe
tails basic where basic.product.id in (:productid) and basic.agentType.id=:agent
Typeid and basic.coInsurerOption=:coInsurerOption and basic.location.id in (:loc
ationcodeid0_, :locationcodeid1_, :locationcodeid2_)]
at net.sf.hibernate.hql.QueryTranslator.getNamedParameterLocs(QueryTrans
lator.java:378)
at net.sf.hibernate.hql.QueryTranslator.bindNamedParameters(QueryTransla
tor.java:710)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:407)

at net.sf.hibernate.loader.Loader.doFind(Loader.java:118)
at net.sf.hibernate.loader.Loader.find(Loader.java:507)
at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:856)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1329)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:68)
at com.webify.ccpa.db.Plan.PlanDefinitionHelper.getOverLaps(PlanDefiniti
onHelper.java:629)
at org.apache.jsp.$5_0005f9_0005fOverlap_0005fPlan$jsp._jspService($5_00
05f9_0005fOverlap_0005fPlan$jsp.java:127)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspSer
vlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
81)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360
)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicati
onHandler.java:280)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:5
53)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1717)
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplication
Context.java:549)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1667)
at org.mortbay.http.HttpServer.service(HttpServer.java:862)
at org.jboss.jetty.Jetty.service(Jetty.java:497)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:759)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:923)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:776)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
202)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2003 7:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Try out 2.1. I think this is a recently-fixed bug.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.