diff options
author | Determe, Sebastien (sd378r) <sd378r@intl.att.com> | 2017-09-13 16:12:45 +0200 |
---|---|---|
committer | Determe, Sebastien (sd378r) <sd378r@intl.att.com> | 2017-09-13 16:12:45 +0200 |
commit | 367b2a23d5149f26b51fedee04667f07ed7b6c97 (patch) | |
tree | db703b293cbae49e79a479859bd46479aab6228f /src/main/java/org | |
parent | 23717d3c29d319502914fcf8507089c360e178e1 (diff) |
Rework the datasource access
Make a call to Spring datasource instead calling the method directly
Change-Id: If9464f8591cd140079d09dc33c83a8b4380bf5ae
Issue-ID: CLAMP-54
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/onap/clamp/clds/config/CldsConfiguration.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/org/onap/clamp/clds/config/CldsConfiguration.java b/src/main/java/org/onap/clamp/clds/config/CldsConfiguration.java index fa0ca961..c00deea6 100644 --- a/src/main/java/org/onap/clamp/clds/config/CldsConfiguration.java +++ b/src/main/java/org/onap/clamp/clds/config/CldsConfiguration.java @@ -52,6 +52,7 @@ import org.onap.clamp.clds.dao.CldsDao; import org.onap.clamp.clds.model.refprop.RefProp; import org.onap.clamp.clds.transform.XslTransformer; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.ApplicationContext; @@ -67,7 +68,7 @@ public class CldsConfiguration { private ApplicationContext context; /** - * Clds Identity databse DataSource configuration + * Clds Identity database DataSource configuration */ @Bean(name = "cldsDataSource") @ConfigurationProperties(prefix = "spring.datasource.cldsdb") @@ -86,9 +87,9 @@ public class CldsConfiguration { } @Bean(name = "cldsDao") - public CldsDao getCldsDao() { + public CldsDao getCldsDao(@Qualifier("cldsDataSource") DataSource dataSource) { CldsDao cldsDao = new CldsDao(); - cldsDao.setDataSource(cldsDataSource()); + cldsDao.setDataSource(dataSource); return cldsDao; } |