这是我的存储过程,它有一个输出参数:
create or replace
PROCEDURE CITYMST_LIST
(
P_CURSOR OUT sys_refcursor
,CMPID IN NUMBER
, STSTATUS IN NUMBER
) AS
BEGIN
OPEN P_CURSOR FOR
SELECT * FROM city_master WHERE citycmp_id=CMPID AND city_status=STSTATUS;
END CITYMST_LIST;
在我的 hbm 配置中,我映射了存储过程:
<sql-query name="CITYMST_LIST" callable="true">
<return class="CityMaster">
</return>
{ ? = call CITYMST_LIST(?,?) }
</sql-query>
I have also tried :
{ call CITYMST_LIST(?,?) }
这是我的java代码:
Query query = session.getNamedQuery("CITYMST_LIST");
query.setParameter("CMPID",Cmpid);
query.setParameter("STSTATUS",true);
list = query.list();