【发布时间】:2012-12-08 23:06:16
【问题描述】:
我正在尝试从 Oracle 11g 中的存储函数中获取返回值(整数值)。
函数将输入数字加10:
FUNCTION ADD_TEN(INPUT IN NUMBER) RETURN NUMBER IS
BEGIN
RETURN INPUT + 10;
END;
在我的映射器界面中,我有一行:
Integer add(Integer input);
在 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>`
对方法的调用是这样的:
Integer sum = mapper.add(45);
但我收到以下错误:
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'
我做错了什么?我真的迷路了……
谢谢。
【问题讨论】:
标签: java oracle return mybatis