返回值Mybatis

Cha*_*les 7 java oracle return mybatis

我正在尝试从Oracle 11g中的存储函数获取返回值(Integer值).

该函数将10添加到输入数字:

FUNCTION ADD_TEN(INPUT IN NUMBER) RETURN NUMBER IS 
BEGIN 
    RETURN INPUT + 10; 
END;
Run Code Online (Sandbox Code Playgroud)

在我的mapper界面中,我有一行:

Integer add(Integer input); 
Run Code Online (Sandbox Code Playgroud)

并在Xml文件中

<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>`
Run Code Online (Sandbox Code Playgroud)

对方法的调用如下:

Integer sum = mapper.add(45); 
Run Code Online (Sandbox Code Playgroud)

但是我收到以下错误:

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' 
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?我真的迷失了......

谢谢.

Cha*_*les 1

解决办法:MyBatis返回类型必须是void. 我正在寻找的结果参数位于函数/过程返回的 ResultMap 中。