SSM项目中,查询返回整型(int) 报错解析

xiaoxiao2025-09-15  24

报错原文:org.apache.ibatis.binding.BindingException: Mapper method 'com.bill.springMybatis.dao.UserDao.getUserIdByName attempted to return null from a method with a primitive return type (int).

解决方案: 返回类型设置为封装类型Integer而不是基本类型int

注意:请将其他层(例如:service,dao,controller)的返回值也改为integer!!!!

转载请注明原文地址: https://www.6miu.com/read-5036358.html

最新回复(0)