-->
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.  [ 1 post ] 
Author Message
 Post subject: Stored Procedure Call: "Errors in named queries"
PostPosted: Tue Oct 23, 2007 1:07 pm 
Newbie

Joined: Tue Oct 23, 2007 12:14 pm
Posts: 2
There are many many posts on this forum for people having issues with Calling Stored procedures form hibernate but unfortunately none of them have solutions.

I am trying to create a sql-query mapping in order to call a stored procedure as per the documentation found here, http://www.hibernate.org/hib_docs/refer ... rysql.html. When implementing I get the very generic error message of "Errors in named Query".

My syntax seems appropriate given the example but have a few confirmations to make.
    Is the return-alias the DTO that the result will map to? Can i assume the return-property tags are the variables in that DTO?
    The call has two parameters, one for the resultset and one for the input parameter. Is it implied that the setParameter() on the java side is the parameter and the return-alias is the return?


Thanks you in advance for any help!!!!

Note: I have gotten around this in the meantime by calling the PROC in a createSQLQuery call and parsing out the result in the returned Object[]. While this works it is not optimal as the PROC itself could change it's signature underneath and the application would break without warning.

Hibernate version:
3.3

Mapping documents:
<sql-query name="fraudulentPanCheck_SP" callable="true">
<return alias="fraudulentPanCheck" class="com.abebooks.fraud.fraudulentpan.FraudulentPanCheckImpl">
<return-property name="status" column="STATUS"/>
<return-property name="fradulentPanId" column="FRAUDULENTPANID"/>
</return>
{ ? = call abedba.FRAUD_DETECTION_API.check_negative_pan(?) }
</sql-query>

Code between sessionFactory.openSession() and session.close():
fraudPanCheckResult = session.getNamedQuery("fraudulentPanCheck_SP")
.setParameter("p_ccnumber",goodPan)
.list();

Full stack trace of any exception that occurs:
org.hibernate.HibernateException: Errors in named queries: fraudulentPanCheck_SP
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:365)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)

Name and version of the database you are using:
Oracle 9i

The generated SQL (show_sql=true):
N/A

Debug level Hibernate log excerpt:
DEBUG


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

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.