emmanuel wrote:
use the createSQLQuery feature
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)
Pls provide me support,