1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.sql.spring;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import org.kuali.common.jdbc.project.spring.JdbcPropertyLocationsConfig;
22 import org.kuali.common.util.properties.Location;
23 import org.kuali.common.util.properties.PropertiesService;
24 import org.kuali.common.util.properties.spring.DefaultPropertiesServiceConfig;
25 import org.kuali.common.util.spring.PropertySourceUtils;
26 import org.kuali.common.util.spring.service.PropertySourceConfig;
27 import org.springframework.beans.factory.annotation.Autowired;
28 import org.springframework.context.annotation.Bean;
29 import org.springframework.context.annotation.Configuration;
30 import org.springframework.context.annotation.Import;
31 import org.springframework.core.env.PropertySource;
32
33
34
35
36
37
38 @Configuration
39 @Import({ SourceSqlProjectConfig.class, SourceSqlPropertyLocationsConfig.class, JdbcPropertyLocationsConfig.class, DefaultPropertiesServiceConfig.class })
40 public class SourceSqlPSC implements PropertySourceConfig {
41
42 @Autowired
43 JdbcPropertyLocationsConfig jdbcConfig;
44
45 @Autowired
46 SourceSqlPropertyLocationsConfig sourceSqlConfig;
47
48 @Autowired
49 PropertiesService service;
50
51 @Override
52 @Bean
53 public PropertySource<?> propertySource() {
54
55 List<Location> locations = new ArrayList<Location>();
56 locations.addAll(jdbcConfig.jdbcPropertyLocations());
57 locations.addAll(sourceSqlConfig.riceSourceSqlPropertyLocations());
58 return PropertySourceUtils.getPropertySource(service, locations);
59 }
60
61 }