SSM---Mybatis配置DB2存储过程只返回一个参数

如题,然后就出现了如下的问题:

org.apache.ibatis.binding.BindingException: Mapper method 'com.zlw.mapper.CommonMapper.queryIntegraInfo attempted to return null from a method with a primitive return type (int).
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:69)
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:43)
    at com.sun.proxy.$Proxy13.queryIntegraInfo(Unknown Source)
    at com.zlw.test.Test.test(Test.java:108)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
 

配置:
<!-- 获取当天是否登录过 -->
	<select id="queryIntegraInfo" parameterType="java.util.Map" statementType="CALLABLE" resultType="java.lang.Integer">
		{CALL PRC_MOBILE_QUERYINTEGRAINFO(
				#{openId,		mode=IN},
				#{type,			mode=IN},
				#{isIntegra,	mode=OUT, jdbcType=INTEGER}
		)}
	</select>

java:
integer queryIntegraInfo(Map<String, Object> map);

乍一看,没有任何毛病,但是仔细一看java代码。代表这个方法返回了一个Integer的类型数据。但是实际并不是这样的。

由于我的入参形式是map形式。返回是自动会放在map里面的。而不是直接以Integer的形式放回。

要用map.get(“isIntegra”)的方式去获取!!!

java: 改成:void queryIntegraInfo(Map<String, Object> map);就好了

找了好久这个问题、还是不仔细导致的问题。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值