Hi there,
I've got a SP in Oracle that returns a collection of object:
Code:
create or replace TYPE SAMPLED_VALUE AS OBJECT
( data_timestamp date,
data_value number(8,2)
);
create or replace TYPE SAMPLED_VALUES_ARRAY AS TABLE OF SAMPLED_VALUE;
valuesMap := sampled_values_array();
I would use a named query to call the SP but I don't know how to map the returned value and the input parameters. The signature of my SP is the following:
Code:
create or replace
PROCEDURE MY_SP(
id IN NUMBER, dateFrom IN DATE, dateTo IN DATE, step VARCHAR2, valuesMap OUT NOCOPY SAMPLED_VALUES_ARRAY, error_code OUT NOCOPY NUMBER, error_description OUT NOCOPY VARCHAR2
) AS
...
Can you help me, if is it possible to have an Oracle collection mapped in Hibernate?
Indeed, I've just read this in the reference doc:
Quote:
Stored procedures currently only return scalars and entities. <return-join> and <loadcollection>
are not supported.
Also, it seems that there are some strict rules in using SP with Hibernate:
Quote:
The first parameter of a procedure must be an OUT that
returns a result set. This is done by using a SYS_REFCURSOR type in Oracle 9 or 10. In Oracle
you need to define a REF CURSOR type. See Oracle literature for further information.