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

问题:

Caused by: org.apache.ibatis.binding.BindingException: Mapper method 'com.itheima.mapper.BrandMapper.SelectTotalCount attempted to return null from a method with a primitive return type (int).

翻译:

由 org.apache.ibatis.binding.BindingException: 映射器方法‘com.itheima.mapper.BrandMapper.SelectTotalCount 试图从具有基本返回类型(int)的方法返回空。

分析:

该方法的sql语句返回的是int,但加了resultMap。

posted @ 2023-04-08 17:27  10kcheung  阅读(20)  评论(0)    收藏  举报