Java 类org.springframework.jdbc.core.support.JdbcDaoSupport 实例源码

项目:bdf2    文件:DataSourceRepository.java   
public void afterPropertiesSet() throws Exception {
    Map<String, DataSourceRegister> dataSourceRegisters = applicationContext.getBeansOfType(DataSourceRegister.class);
    for (DataSourceRegister dataSourceRegister : dataSourceRegisters.values()) {
        dataSources.put(dataSourceRegister.getName(), dataSourceRegister.getDataSource());
        JdbcDaoSupport jdbcDaoSupport = new JdbcDaoSupport(){};
        jdbcDaoSupport.setDataSource(dataSourceRegister.getDataSource());
        jdbcTemplateMap.put(dataSourceRegister.getName(),jdbcDaoSupport.getJdbcTemplate());
        if(dataSourceRegister.isAsDefault()){
            defaultDataSourceName=dataSourceRegister.getName();
            this.defaultJdbcTemplate=jdbcDaoSupport.getJdbcTemplate();
        }
    }
}
项目:bdf2    文件:DataSourceRepository.java   
public void afterPropertiesSet() throws Exception {
    Map<String, DataSourceRegister> dataSourceRegisters = applicationContext.getBeansOfType(DataSourceRegister.class);
    for (DataSourceRegister dataSourceRegister : dataSourceRegisters.values()) {
        dataSources.put(dataSourceRegister.getName(), dataSourceRegister.getDataSource());
        JdbcDaoSupport jdbcDaoSupport = new JdbcDaoSupport(){};
        jdbcDaoSupport.setDataSource(dataSourceRegister.getDataSource());
        jdbcTemplateMap.put(dataSourceRegister.getName(),jdbcDaoSupport.getJdbcTemplate());
        if(dataSourceRegister.isAsDefault()){
            defaultDataSourceName=dataSourceRegister.getName();
            this.defaultJdbcTemplate=jdbcDaoSupport.getJdbcTemplate();
        }
    }
}