summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/commons/db-lib/src
diff options
context:
space:
mode:
authorSingal, Kapil (ks220y) <ks220y@att.com>2019-01-28 14:17:48 -0500
committerKAPIL SINGAL <ks220y@att.com>2019-01-29 20:05:35 +0000
commit694217a818ec3b087a19c5f6bfaf516a191e8ea5 (patch)
treee82edfc70c92c795daadd9df5ced30332dce692a /ms/blueprintsprocessor/modules/commons/db-lib/src
parenteac0ff52589c4dd0c3f26a25991f89b5c8743ff9 (diff)
Resource Resolution Service: Rest and DB
Emhancement to Primary-Data and Rest Resource Assignment Processor and respective services Change-Id: I9cc125f9e6396d9c26f72ebd05d2f0422a301f1c Issue-ID: CCSDK-699 Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/db-lib/src')
-rw-r--r--ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BluePrintDBLibGenericService.kt16
-rw-r--r--ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDBLibGenericService.kt (renamed from ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/service/PrimaryDBLibGenericService.kt)18
2 files changed, 20 insertions, 14 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BluePrintDBLibGenericService.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BluePrintDBLibGenericService.kt
index 86420f9a6..aee74d3f4 100644
--- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BluePrintDBLibGenericService.kt
+++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BluePrintDBLibGenericService.kt
@@ -25,4 +25,20 @@ interface BluePrintDBLibGenericService {
fun query(sql: String, params: Map<String, Any>): List<Map<String, Any>>
fun update(sql: String, params: Map<String, Any>): Int
+}
+
+abstract class AbstractDBLibGenericService(private val namedParameterJdbcTemplate: NamedParameterJdbcTemplate)
+ : BluePrintDBLibGenericService {
+
+ override fun namedParameterJdbcTemplate(): NamedParameterJdbcTemplate {
+ return namedParameterJdbcTemplate
+ }
+
+ override fun query(sql: String, params: Map<String, Any>): List<Map<String, Any>> {
+ return namedParameterJdbcTemplate.queryForList(sql, params)
+ }
+
+ override fun update(sql: String, params: Map<String, Any>): Int {
+ return namedParameterJdbcTemplate.update(sql, params)
+ }
} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/service/PrimaryDBLibGenericService.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDBLibGenericService.kt
index 87f32ef2d..0e0f1e9c1 100644
--- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/service/PrimaryDBLibGenericService.kt
+++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDBLibGenericService.kt
@@ -14,25 +14,15 @@
* limitations under the License.
*/
-package org.onap.ccsdk.apps.blueprintsprocessor.db.primary.service
+package org.onap.ccsdk.apps.blueprintsprocessor.db.primary
+import org.onap.ccsdk.apps.blueprintsprocessor.db.AbstractDBLibGenericService
import org.onap.ccsdk.apps.blueprintsprocessor.db.BluePrintDBLibGenericService
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
import org.springframework.stereotype.Service
@Service
-class PrimaryDBLibGenericService(private val primaryNamedParameterJdbcTemplate: NamedParameterJdbcTemplate)
- : BluePrintDBLibGenericService {
+open class PrimaryDBLibGenericService(private val primaryNamedParameterJdbcTemplate: NamedParameterJdbcTemplate)
+ : AbstractDBLibGenericService(primaryNamedParameterJdbcTemplate) {
- override fun namedParameterJdbcTemplate(): NamedParameterJdbcTemplate {
- return primaryNamedParameterJdbcTemplate
- }
-
- override fun query(sql: String, params: Map<String, Any>): List<Map<String, Any>> {
- return primaryNamedParameterJdbcTemplate.queryForList(sql, params)
- }
-
- override fun update(sql: String, params: Map<String, Any>): Int {
- return primaryNamedParameterJdbcTemplate.update(sql, params)
- }
} \ No newline at end of file