at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:229)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.(MybatisMapperMethod.java:50)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.lambda$cachedInvoker$0(MybatisMapperProxy.java:111)
at com.baomidou.mybatisplus.core.toolkit.CollectionUtils.computeIfAbsent(CollectionUtils.java:143)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.cachedInvoker(MybatisMapperProxy.java:98)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
at com.sun.proxy.$Proxy332.insertBatchSomeColumn(Unknown Source)
当前使用版本(必填,否则不予处理)
Mybatis-Plus3.5.5
该问题是如何引起的?(确定最新版也有问题再提!!!)
Mybatis-Plus3.5.5 版本在扩展DefaultSqlInjector时,无法调用扩展的Mapper方法
重现步骤(如果有就写完整)
1、定义扩展类 @Component public class InsertBatchSqlInjector extends DefaultSqlInjector {
}
2、定义Mapper public interface MyBaseMapper extends BaseMapper {
}
3、继承MyBaseMapper public interface DemoMapper extends MyBaseMapper {
}
4、设置sqlInjector @Override public void run(String... args) { Configuration configuration = sessionFactory.getConfiguration(); GlobalConfig globalConfig = GlobalConfigUtils.getGlobalConfig(configuration); globalConfig.setSqlInjector(insertBatchSqlInjector); }
5、调用insertBatchSomeColumn方法 demoMapper.insertBatchSomeColumn(list))
报错信息
在调用demoMapper.insertBatchSomeColumn(list))时,报org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):demo.mapper.DemoMapper.insertBatchSomeColumn
at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:229)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.(MybatisMapperMethod.java:50)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.lambda$cachedInvoker$0(MybatisMapperProxy.java:111)
at com.baomidou.mybatisplus.core.toolkit.CollectionUtils.computeIfAbsent(CollectionUtils.java:143)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.cachedInvoker(MybatisMapperProxy.java:98)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
at com.sun.proxy.$Proxy332.insertBatchSomeColumn(Unknown Source)