From 4cfbc764a37018f98d849654e2d5b94155ec85b6 Mon Sep 17 00:00:00 2001 From: Prudence Au Date: Wed, 12 May 2021 13:23:29 -0400 Subject: Add MS SQL driver in CDS blueprints and DB resolution fails on an empty dataset with required template mapping. Issue-ID: CCSDK-3293 Issue-ID: CCSDK-3294 Signed-off-by: Prudence Au Change-Id: I9f302d12e7359b62180fcdfddbd8ae2c993a8324 --- .../resolution/processor/DatabaseResourceAssignmentProcessor.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ms/blueprintsprocessor/functions') 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 db5307f17..114b5b889 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 @@ -112,11 +112,11 @@ open class DatabaseResourceAssignmentProcessor( val jdbcTemplate = blueprintDBLibService(sourceProperties, dSource) val rows = jdbcTemplate.query(sql, populateNamedParameter(inputKeyMapping)) - if (rows.isNullOrEmpty()) { - logger.warn("Failed to get $dSource result for dictionary name ($dName) the query ($sql)") - } else { - populateResource(resourceAssignment, sourceProperties, rows) + if (rows.isEmpty()) { + logger.warn("Emptyset from dictionary-source($dSource) for dictionary name ($dName) the query ($sql).") } + logger.debug("Query returned ${rows.size} values") + populateResource(resourceAssignment, sourceProperties, rows) } private fun blueprintDBLibService(sourceProperties: DatabaseResourceSource, selector: String): BlueprintDBLibGenericService { -- cgit 1.2.3-korg