原文:Mapper method 'com.xxxx.other.dao.MyDao.getNo attempted to return null from a method with a primitive return type (int)

使用myBatis调用存储过程的返回值,提示错误信息: org.apache.ibatis.binding.BindingException: Mapper method com.xxxx.other.dao.MyDao.getNo attempted to return null from a method with a primitive return type int . 先查mysql监控 ...

2019-08-12 11:33 0 712 推荐指数:

查看详情

attempted to return null from a method with a primitive return type (int)

解决方法: 方法1:将boolean、int、long等基本数据类型改为封装数据类型,boolean封装数据类型为Boolean、int封装数据类型为Integer,根据个人项目逻辑,对返回值进行判断即可。方法2:使用MySQL种的IFNULL函数,IFNULL函数是MySQL控制流函数 ...

Tue Feb 25 23:36:00 CST 2020 0 2918
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM