Hello,
I am trying to call the following stored function from my code using hibernate:
FUNCTION setUserObjectIDACL (
u_usertype IN number,
u_userid IN varchar2,
o_objectsystem IN number,
o_objecttype IN number,
o_objectid IN varchar2,
o_newallow IN number,
o_newdeny IN number,
o_child IN number := 0) RETURN number
IS
................
BEGIN
..................
..................
..................
-- return the allow value set
RETURN o_setallow;
END setUserObjectIDACL;
This is how I am defining it in my mapping file:
<sql-query name="setUserObjectIDACL" callable="true">
<return-scalar column="o_setallow" type="int" />
{ ? = call CCC_PROC.setUserObjectIDACL(?, ?, ?, ?, ?, ?, ?)}
</sql-query>
This is how my Java code calls it:
Query namedQuery = hSession.getNamedQuery("setUserObjectIDACL")
.setInteger(0, temp)
.setString(1, userID)
.setInteger(2, objectSystem)
.setInteger(3, objectType)
.setString(4, objectID)
.setInteger(5, allowValue)
.setInteger(6, denyValue);
Integer id = (Integer) namedQuery.uniqueResult();
But I am getting the following error:
15:55:10,861 ERROR [JDBCExceptionReporter] ORA-06550: line 1, column 13:
PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
15:55:10,861 ERROR [ACLUtilities] Exception while executing stored procedure setUserObjectIDACL
15:55:10,861 ERROR [STDERR] org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2223)
I'll really appreciate if anyone lets me know if I am doing anything incorrectly.
Thanks,
Bhuwan.
|