summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2020-01-02 10:15:16 +0000
committerGerrit Code Review <gerrit@onap.org>2020-01-02 10:15:16 +0000
commit3ae14200731cd37967e5cad9802ec9fb3f5cd078 (patch)
treefa1c0f3894f93454968854c351aedb8ed59f1abf
parent9364e31c8bc851b7543b0c16846dc6ef3ccf41c3 (diff)
parent6ae9e37abf54b9eb311d9705746d4203055cb97a (diff)
Merge "improve getAllTemplatesServiceModelIds query"
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/dal/AsyncInstantiationRepository.kt11
1 files changed, 5 insertions, 6 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/dal/AsyncInstantiationRepository.kt b/vid-app-common/src/main/java/org/onap/vid/dal/AsyncInstantiationRepository.kt
index b638a03e3..b23a4642b 100644
--- a/vid-app-common/src/main/java/org/onap/vid/dal/AsyncInstantiationRepository.kt
+++ b/vid-app-common/src/main/java/org/onap/vid/dal/AsyncInstantiationRepository.kt
@@ -163,11 +163,10 @@ class AsyncInstantiationRepository @Autowired constructor(val dataAccessService:
dataAccessService.getList(ServiceInfo::class.java, filterInstantiatedServiceByServiceModelId(serviceModelId), orderByCreatedDateAndStatus(), null) as List<ServiceInfo>;
fun getAllTemplatesServiceModelIds(): Set<String> {
- val allTemplatesInfo =
- dataAccessService.getList(ServiceInfo::class.java, filterByInstantiateActionStatus(), null, null) as List<ServiceInfo>
-
- return allTemplatesInfo
- .map { it.serviceModelId }
- .toHashSet()
+ val allTemplatesServiceModelID: List<String> =
+ dataAccessService.executeQuery(
+ "select distinct serviceModelId from ServiceInfo ${filterByInstantiateActionStatus()}",
+ null) as List<String>
+ return allTemplatesServiceModelID.toHashSet()
}
}