Closed superlyao closed 4 years ago
JDK Version(required): 1.8.0_201
SpringBoot Version(required): 2.1.2.RELEASE
dynamic-datasource-spring-boot-starter Version(required): 3.1.0
druid Version(optional):1.1.9
项目中有多种数据源,
SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); bean.setDataSource(dataSource); bean.setMapperLocations(resolver.getResources(mapperLocations)); return bean.getObject();
之前的代码在配置datasource就可以配置setMapperLocations,现在使用动态数据源,如何配置每个数据源的mapperLocations
setMapperLocations
mapperLocations
Expected Result:
Actual Result:
Step 1
Step 2
Step 3
https://blog.csdn.net/qq_42685050/article/details/81427865 你可能比较适合静态多数据源。
Enviroment
JDK Version(required): 1.8.0_201
SpringBoot Version(required): 2.1.2.RELEASE
dynamic-datasource-spring-boot-starter Version(required): 3.1.0
druid Version(optional):1.1.9
Describe
项目中有多种数据源,
之前的代码在配置datasource就可以配置
setMapperLocations
,现在使用动态数据源,如何配置每个数据源的mapperLocations
Expected Result:
Actual Result:
Steps to reproduce
Step 1
Step 2
Step 3