X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ms%2Fblueprintsprocessor%2Ffunctions%2Fresource-resolution%2Fsrc%2Fmain%2Fkotlin%2Forg%2Fonap%2Fccsdk%2Fcds%2Fblueprintsprocessor%2Ffunctions%2Fresource%2Fresolution%2Fprocessor%2FDatabaseResourceAssignmentProcessor.kt;fp=ms%2Fblueprintsprocessor%2Ffunctions%2Fresource-resolution%2Fsrc%2Fmain%2Fkotlin%2Forg%2Fonap%2Fccsdk%2Fcds%2Fblueprintsprocessor%2Ffunctions%2Fresource%2Fresolution%2Fprocessor%2FDatabaseResourceAssignmentProcessor.kt;h=2640b5b85f7da6c87b61182ff6743b9a92a56b7c;hb=87bf1928aa4772c3b953a0a5800bec99f23b6e9c;hp=a0fa97b6df09990f7efec1702610c2e1e9ba9724;hpb=3a27f2fee05ef874181ea818f28329c2567e52c5;p=ccsdk%2Fcds.git diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt index a0fa97b6d..2640b5b85 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt @@ -107,7 +107,7 @@ open class DatabaseResourceAssignmentProcessor( "DatabaseResource ($dSource) dictionary information: " + "Query:($sql), input-key-mapping:($inputKeyMapping), output-key-mapping:(${sourceProperties.outputKeyMapping})" ) - val jdbcTemplate = blueprintDBLibService(sourceProperties) + val jdbcTemplate = blueprintDBLibService(sourceProperties, dSource) val rows = jdbcTemplate.query(sql, populateNamedParameter(inputKeyMapping)) if (rows.isNullOrEmpty()) { @@ -117,12 +117,12 @@ open class DatabaseResourceAssignmentProcessor( } } - private fun blueprintDBLibService(sourceProperties: DatabaseResourceSource): BluePrintDBLibGenericService { + private fun blueprintDBLibService(sourceProperties: DatabaseResourceSource, selector: String): BluePrintDBLibGenericService { return if (isNotEmpty(sourceProperties.endpointSelector)) { val dbPropertiesJson = raRuntimeService.resolveDSLExpression(sourceProperties.endpointSelector!!) bluePrintDBLibPropertyService.JdbcTemplate(dbPropertiesJson) } else { - primaryDBLibGenericService + bluePrintDBLibPropertyService.JdbcTemplate(selector) } }