mybatis使用xml实现发生的异常之一return null from a method with a primitive return type (int)

主要原因:

1、接口的返回值错误

2、接口的xml错误  ( 主要是标签写错了)

在这里我的接口:

 发现这句并没有错误,那我再看接口的xml:

很明显的就发现了select这里错误,insert,update,delect这些返回值为int类型,是不用写返回值的;

这里是标签写错了:

修改后的代码:

 把resultType去掉:

猜你喜欢

转载自www.cnblogs.com/bichen-01/p/11730252.html