tk.mybatis.mapper.provider.base.BaseInsertProvider.()

出现这个错误是通用Mapper初始化的错误,排查的方向就是往这个方向,可能的情况有以下几种:

  1. 1.jar包冲突

  2. MapperCan 扫包配置错误
    我的错误就是扫描包错误。我的项目是采用spring-boot,在扫描的时候注解为

@Configuration
@ComponentScan(basePackages = {com.example.reposity})
@EnableTransactionManagement(proxyTargetClass = true)
public class MyBatisConfiguration{

但是生成的BaseInsertProvider不在这个扫描包下所以失败了。
将这个改成对应的父类的包,扫描该包下所有的包即可。

猜你喜欢

转载自blog.csdn.net/caoPengFlying/article/details/88695465
今日推荐