-->
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.  [ 3 posts ] 
Author Message
 Post subject: Alias doesn't correspond to any of the supplied return alias
PostPosted: Wed Apr 21, 2004 1:46 am 
Newbie

Joined: Mon Apr 19, 2004 10:12 am
Posts: 19
Location: India
Hi,

Iam getting an exception when Iam using the sql query as follows,

select {cvo.customeridvc,cvo.customernamevc,cvo.shortnamevc,cvo.creditstatusvc,cgvo.groupnamevc,evo.lastnamevc} from customer as {cvo}
left outer join customergroup as {cgvo} on cgvo.custgroupidvc=cgvo.custgroupidvc

The exception as follows,

ERROR [STDERR] net.sf.hibernate.QueryException: Alias [cvo.customeridvc,cvo.customernamevc,cvo.shortnamevc,cvo.creditstatusvc,cgvo.groupnamevc,evo] does not correspond to any of the supplied return aliases = {[cvo]} [select {cvo.customeridvc,cvo.customernamevc,cvo.shortnamevc,cvo.creditstatusvc,cgvo.groupnamevc,evo.lastnamevc} from customer as {cvo}left outer join customergroup as {cgvo} on (cvo.custgroupidvc=cgvo.custgroupidvc) order by lower(cvo.customernamev
at net.sf.hibernate.loader.SQLLoader.substituteBrackets(SQLLoader.java:131)
at net.sf.hibernate.loader.SQLLoader.renderStatement(SQLLoader.java:85)
at net.sf.hibernate.loader.SQLLoader.<init>(SQLLoader.java:71)
at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3622)
at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52)
at com.pcc.pcs.dao.customer.CustomerDAOImpl.searchCustomer(CustomerDAOImpl.java:506)
at com.pcc.pcs.web.struts.customer.SearchCustomerAction.execute(SearchCustomerAction.java:99)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:356)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1723)
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:514)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1673)
at org.mortbay.http.HttpServer.service(HttpServer.java:879)
at org.jboss.jetty.Jetty.service(Jetty.java:459)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:783)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:945)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:800)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:201)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:454)

Thanks for your advice on this subject

_________________
Ravi Kumar


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 21, 2004 2:24 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
have read twice the doc about sql query?


Top
 Profile  
 
 Post subject: CreateSQLQuery not getting the results from multiple tables
PostPosted: Wed Apr 21, 2004 5:20 am 
Newbie

Joined: Mon Apr 19, 2004 10:12 am
Posts: 19
Location: India
delpouve wrote:
have read twice the doc about sql query?


Sorry, i didnot post the entire query.

the query is
createSQLQuery("select {cvo}.customeridvc,{cvo}.customernamevc,{cvo}.shortnamevc,{cvo}.creditstatusvc,{cgvo}.groupnamevc from customer as {cvo}
left outer join customergroup as {cgvo} on cgvo.custgroupidvc=cgvo.custgroupidvc");

I need to get the data from both the tables customer and customer group. No where in the hibernate reference an example is given to get the data from multiple tables using the createSQLQuery statement with left outer join.

Can you please help me out.

_________________
Ravi Kumar


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