|
@@ -1,54 +0,0 @@
|
|
|
-//package com.hssx.pcbms.config;
|
|
|
|
|
-//
|
|
|
|
|
-//import org.apache.ibatis.session.SqlSessionFactory;
|
|
|
|
|
-//import org.mybatis.spring.SqlSessionFactoryBean;
|
|
|
|
|
-//import org.mybatis.spring.SqlSessionTemplate;
|
|
|
|
|
-//import org.mybatis.spring.annotation.MapperScan;
|
|
|
|
|
-//import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
|
|
-//import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
|
-//import org.springframework.boot.jdbc.DataSourceBuilder;
|
|
|
|
|
-//import org.springframework.context.annotation.Bean;
|
|
|
|
|
-//import org.springframework.context.annotation.Configuration;
|
|
|
|
|
-//import org.springframework.context.annotation.Primary;
|
|
|
|
|
-//import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
|
|
|
|
-//import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
|
|
|
|
-//
|
|
|
|
|
-//import javax.sql.DataSource;
|
|
|
|
|
-//
|
|
|
|
|
-///**
|
|
|
|
|
-// * Author: 吴涛涛 cuiyi@itany.com
|
|
|
|
|
-// * Date : 2019 - 11 - 14 15:16
|
|
|
|
|
-// * Description:<描述>
|
|
|
|
|
-// * Version: 1.0
|
|
|
|
|
-// */
|
|
|
|
|
-//@Configuration
|
|
|
|
|
-//@MapperScan(basePackages = "com.hssx.pcbms.mapper", sqlSessionTemplateRef = "db1SqlSessionTemplate")
|
|
|
|
|
-//public class Db1Configuration {
|
|
|
|
|
-// @Bean(name = "db1DataSource")
|
|
|
|
|
-// @ConfigurationProperties(prefix = "spring.datasource.hikari.db1")
|
|
|
|
|
-// @Primary
|
|
|
|
|
-// public DataSource testDataSource() {
|
|
|
|
|
-// return DataSourceBuilder.create().build();
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// @Bean(name = "db1SqlSessionFactory")
|
|
|
|
|
-// @Primary
|
|
|
|
|
-// public SqlSessionFactory testSqlSessionFactory(@Qualifier("db1DataSource") DataSource dataSource) throws Exception {
|
|
|
|
|
-// SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
|
|
|
|
|
-// bean.setDataSource(dataSource);
|
|
|
|
|
-// bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/*.xml"));//指定mapper.xml路径
|
|
|
|
|
-// return bean.getObject();
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// @Bean(name = "db1TransactionManager")
|
|
|
|
|
-// @Primary
|
|
|
|
|
-// public DataSourceTransactionManager testTransactionManager(@Qualifier("db1DataSource") DataSource dataSource) {
|
|
|
|
|
-// return new DataSourceTransactionManager(dataSource);
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// @Bean(name = "db1SqlSessionTemplate")
|
|
|
|
|
-// @Primary
|
|
|
|
|
-// public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("db1SqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception {
|
|
|
|
|
-// return new SqlSessionTemplate(sqlSessionFactory);
|
|
|
|
|
-// }
|
|
|
|
|
-//}
|
|
|