in.hocg.boot.dynamic.datasource.autoconfiguration.pool.DatasourceHelper Maven / Gradle / Ivy
The newest version!
package in.hocg.boot.dynamic.datasource.autoconfiguration.pool;
import com.google.common.collect.Maps;
import in.hocg.boot.dynamic.datasource.autoconfiguration.properties.DynamicDataSourceProperties;
import lombok.Getter;
import org.springframework.core.env.Environment;
import javax.sql.DataSource;
import java.util.Map;
/**
* Created by hocgin on 2019-09-27.
* email: [email protected]
*
* @author hocgin
*/
@Getter
public abstract class DatasourceHelper {
private final Environment environment;
public DatasourceHelper(Environment environment) {
this.environment = environment;
}
/**
* 获取主数据源
*
* @param properties 配置
* @return
*/
public abstract DataSource getMainDatasource(org.springframework.boot.autoconfigure.jdbc.DataSourceProperties properties);
/**
* 获取次数据源
*
* @param properties 配置
* @return 数据源
*/
public abstract DataSource getSecondaryDataSource(DynamicDataSourceProperties.DataSourceProperties properties);
/**
* 获取多从数据源
*
* @param properties 配置
* @return
*/
public Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy