|
Hi
I am using Hibernate 3.1.Trying to retrieve data from a stored Procedure.
My stored Procedure is
create procedure GET_DEPT_PROCEDURE(P_CURSOR OUT SYS_REFCURSOR,dno IN NUMBER)
BEGIN
open P_CURSOR for
select * from DEPT where deptno=dno;
END;
My hbm file contains the named query as
<sql-query name="DeptDetails" callable="true">
<return alias="DeptObj" class="storedProcs.DeptObj">
<return-property name="dname" column="DNAME"/>
<return-property name="location" column="LOC"/>
<return-property name="deptno" column="DEPTNO"/>
</return>
{ call GET_DEPT_PROCEDURE(?,:deptno) }
</sql-query>
I am using the following java code
s = getHibernateTemplate().getSessionFactory().openSession();
Query f = s.getNamedQuery("DeptDetails").setInteger("deptno",10);
f.list();
How can I set the first positional parameter.. Even though I donot set the value of the first parameter, I can run the prgm and get expected results.
I guess Hibernate takes care of setting this value.If so , I want to know the value of this parameter to be able to set that explcitly which is my requirement (in a different use case of course...).
Is there a method to register OUT params like we have in JDBC..
stmt.registerOutParam(.....)
Thanks in advance
Ramesh
|