有关mybatis查询数据库内记录的总条数问题
作者:互联网
报错如下:
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).
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:102)
at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:152)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85)
at com.sun.proxy.$Proxy28.selectTotalCount(Unknown Source)
at com.itheima.service_20211015_114634.impl.BrandServiceImpl.SelectByPage(BrandServiceImpl.java:50)
at com.itheima.web.servlet.BrandServlet.selectByPage(BrandServlet.java:57)
... 25 more
需要将项目内所有有关的数据都改成Integer类型(包括service等等),因为在数据库内存在查询条数为空的状态;
标签:MapperProxy,java,binding,ibatis,条数,查询数据库,mybatis,org,apache 来源: https://www.cnblogs.com/Mexcellent/p/16185023.html