I try to fill parameter name same this.
<sql-query name="selectAllXXX_SP" callable="true">
<return class="TBLXXX" >
<return-property name="id" column="ID"/>
<return-property name="COL_1" column="COL_1"/>
<return-property name="COL_2" column="COL_2"/>
<return-property name="COL_3" column="COL_3"/>
<return-property name="COL_4" column="COL_4"/>
</return>
{ call TMP_XXXX#SEARCH(?,:param_in) } <--------
</sql-query>
i wonder it work!! I use normal org.hibernate.dialect.Oracle9Dialect
but if I try to pass parameter.
{ call TMP_XXXX#SEARCH(?,:param_in1,:param_in2) } <--------
and when hibernate check for parameters, it reverst form down to up for example.
CREATE OR REPLACE PROCEDURE "TMP_XXXX#SEARCH"
(
result_cursor OUT TYPES.cursor_type, param_in1 IN tbl_xxx.col_1%TYPE, param_in2 IN tbl_xxx.col_2%TYPE ) AS
BEGIN OPEN result_cursor FOR SELECT tbl_XXX.id, tbl_XXX.col_1, tbl_XXX.col_2, tbl_XXX.col_3, tbl_XXX.col_4
FROM tbl_XXX
where tbl_XXX.col_1 = param_in1; AND tbl_XXX.col_2 = param_in2
END; /
---------
and then I call it.
Query q = session.getNamedQuery("selectAllXXX_SP"); q.setParameter("param_in1","xxxx"); // param index [1] q.setParameter("param_in2","xxxx"); // param index [0]
List resultList = q.list();
and It work,
So, but I would like to change parameter index for
result_cursor OUT TYPES.cursor_type,
to param index [0].
Regards,
Suraphat Siri-upatham
Thailand.
|