Today, we encountered an OracleFunction problem when using the Hibernate Development Project. During the project development, all document numbers are generated using a Function.
Today, we encountered an Oracle Function problem when using the Hibernate Development Project. During the project development, all document numbers are generated using a Function.
Today, we encountered an Oracle Function problem when using the Hibernate development project.
During project development, all document numbers are generated using a Function. this Function has some DML syntax, so you cannot use select fun _... () Into v_ref from dual method to obtain the returned result.
After querying the relevant information, Hibernate requires that a cursor be returned when executing Procedure and Function. Therefore, we can add another Function processing method as a work und.
A new Function is defined as follows:
Function fun_get_vou_web (....)
RETURN SYS_REFCURSOR
As
V_vou varchar2 (20 );
St_cursor SYS_REFCURSOR;
BEGIN
V_vou: = fun_get_vou (....);
OPEN st_cursor
SELECT v_vou as vouno from dual;
RETURN st_cursor;
END;
Then configure in hbm. xml:
{? = Call fun_get_vou_web (.......)}
Finally, you can query the execution result of getNewAppNo in java.
,