I am trying to get the return value (integer value) from a stored function in Oracle 11g.
The function adds 10 to the input number:
FUNCTION ADD_TEN(INPUT IN NUMBER) RETURN NUMBER IS BEGIN RETURN INPUT + 10; END;
In my mapper interface, I have a line:
Integer add(Integer input);
And in the xml file
<select id="add" statementType="CALLABLE" resultType='java.lang.Integer'> {#{output,mode=OUT,jdbcType=NUMERIC,javaType=Integer} = call test_pkg.ADD_TEN( #{input,jdbcType=NUMERIC}) } </select>`
The method call looks like this:
Integer sum = mapper.add(45);
But I get the following error:
Could not set property 'output' of 'class java.lang.Integer' with value '55' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'output' in 'class java.lang.Integer'
What am I doing wrong? I am really lost with this ...
Thanks.
source share