Hi All,
I am using Hibernate 3.2 cr3 with oracle 9i & trying to call stored procedure which retrives data 2 columns(subset) of a 5 column table & return resultset. i getting the following exception
ERROR [org.hibernate.util.JDBCExceptionReporter] - <Invalid column name>
i am using getNamedQuery and used following configuration.
Please answer following questions?
1. Does hibernate support only return scalars and entities so that in stored procedure we need to specify select * or all column?
2. How can we use the projection on the stored procedure without using HQL?
Stored procedure
CREATE OR REPLACE PACKAGE BODY Pkg_Test2
IS
PROCEDURE get_my_list(p_record OUT ref_cur ,eventid IN NUMBER)
AS
BEGIN
OPEN p_record FOR
SELECT EVENT_ID, TITLE FROM EVENTS WHERE EVENT_ID=eventid;
END get_my_list;
END Pkg_Test2;
/
mapping file for procedure call
<sql-query name="test_select_sp" callable="true">
<return alias="evaa" class="events.Event">
<return-property name="id" column="EVENT_ID"/>
<return-property name="title" column="TITLE"/>
</return>
{ call pkg_test1.get_selected_list(?,:eventid)}
</sql-query>
Thanks,
Sagar
|