喜欢就价格关注吧,持续分享
前言:
mybatis和mysql 是平时在java项目中经常用到的。今天带大家看一个平时不留意的错误。如果在 mapper中用 int 来接收 数据统计的sql。查不到返回null 会报错么?
不知道的请看下文
答案是会报错的。
org.apache.ibatis.binding.BindingException:Mapper method 'com.*******Mapper.countByExampleattempted to return null from a methodwith a primitive return type (int).

文章转载自全栈的程序员,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




