当前使用版本(必填,否则不予处理)
mybatis-plus-boot-starter 3.4.1
该问题是如何引起的?(确定最新版也有问题再提!!!)
多数据源下自动填充失效
重现步骤(如果有就写完整)
使用如下方法解决: @Bean public MybatisSqlSessionFactoryBean sqlSessionFactory(@Qualifier("dataSource") DataSource dataSource) throws IOException { MybatisSqlSessionFactoryBean mybatisPlus = new MybatisSqlSessionFactoryBean();
//加载数据源
mybatisPlus.setDataSource(dataSource);
//全局配置
GlobalConfig globalConfig = new GlobalConfig();
//配置填充器
globalConfig.setMetaObjectHandler(new AutoFillMetaObjectHandler());
mybatisPlus.setGlobalConfig(globalConfig);
return mybatisPlus;
}
会带来新的问题,就是xml无法正常扫描了
报错信息
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
Comment From: miemieYaho
去抄starter的代码
Comment From: yeruilong
starter的代码在哪呢