@Bean(name = "frontEndUnitProjectSqlSessionFactory")
public SqlSessionFactory imageSqlSessionFactory(@Qualifier("frontEndUnitProjectSqlServerDataSource")DataSource imageSqlServerDataSource )
throws Exception {
MybatisSqlSessionFactoryBean imageSqlSessionFactory = new MybatisSqlSessionFactoryBean();
imageSqlSessionFactory.setDataSource(imageSqlServerDataSource);
imageSqlSessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
.getResources(MAPPER_LOCATION));
MybatisConfiguration configuration = new MybatisConfiguration();
if(detailed_log){
//增加详细日志
configuration.setLogImpl(StdOutImpl.class);
}else{
//增加日志
imageSqlSessionFactory.setConfigLocation(new ClassPathResource("spring/mybatis-config.xml"));
}
configuration.setMapUnderscoreToCamelCase(false);
//设置分页插件
configuration.addInterceptor(new PaginationInterceptor());
imageSqlSessionFactory.setConfiguration(configuration);
return imageSqlSessionFactory.getObject();
}
mybatisc-plus 多数据源 page 没生效
最新推荐文章于 2024-08-02 10:47:17 发布