File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Named no know - Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Named no know - Hibernate" Watch "Named no know - Hibernate" New topic
Author

Named no know - Hibernate

Nicolas Rico
Greenhorn

Joined: Jun 14, 2008
Posts: 1
hello, I`ve got a problem whith sql-query,

<sql-query name="consecutivo_SP" callable="true">
{ ? = call Genera_Consecutivo(?)}
</sql-query>

DAO

Query queryObject = getSession().getNamedQuery(cs_QUERY).setString(0,"A");

When try to run it show me this error:
org.hibernate.MappingException: Named query not known: consecutivo_SP
at org.hibernate.impl.AbstractSessionImpl.getNamedQuery(AbstractSessionImpl.java:70)
at org.hibernate.impl.SessionImpl.getNamedQuery(SessionImpl.java:1260)
at com.zion.dao.ConsecutivosDAO.getConsecutivo(ConsecutivosDAO.java:90)
at com.zion.bussiness.solicitud.SolicitudCptController.getCodigo(SolicitudCptController.java:42)
at com.zion.web.struts.action.SolicitudCptAction.save(SolicitudCptAction.java:327)
at com.zion.web.struts.action.SolicitudCptAction.execute(SolicitudCptAction.java:106)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)

Please help me!!!
Raja Nagendra Kumar
Greenhorn

Joined: Jun 14, 2008
Posts: 27
Are you able to read HQL queries properly. some thing similar at

http://www.javalobby.org/java/forums/m91885316.html

Regards,
Nagendra


Raja Nagendra Kumar,
C.T.O, www.tejasoft.com
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

<sql-query name="consecutivo_SP" callable="true">
{ ? = call Genera_Consecutivo(?)}
</sql-query>


Is that all you have in your document? I mean is there an outer tag that you have? Do you need a <sql-queries> tag surrounding it?

Thanks

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Named no know - Hibernate