原文:Mybatis:Mapper method attempted to return null from a method with a primitive return type (int)

关键词 SpringMVC SSM Mybatis eclipse 报错内容 Mybatis:Mapper method attempted to return null from a method with a primitive return type int 原因 Mapper.xml的标签用错了。。。 低级错误,轻喷。。。 比如本来应该: 插入语句用 lt insert gt lt ins ...

2021-04-09 16:40 1 319 推荐指数:

查看详情

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