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

今天被自己给蠢死了 今天在代码中遇到这个错误, 百度翻译一下:映射方法,从一org.system.mapper.child.chmorganizationexaminationmapper.delete返回零作为一个原始的方法的返回类型 int 。 最后发现的mapper.xml 代码是这样写的:居然用的select。 真的是蠢到家了 ...

2017-08-24 16:50 0 4128 推荐指数:

查看详情

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