From: Eylon Malin Date: Thu, 2 Jan 2020 08:13:06 +0000 (+0200) Subject: improve getAllTemplatesServiceModelIds query X-Git-Tag: 6.0.1~12^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=6ae9e37abf54b9eb311d9705746d4203055cb97a;p=vid.git improve getAllTemplatesServiceModelIds query Issue-ID: VID-739 Change-Id: I0b5520e0d22942a84ca5d6fc54821455ef67f644 Signed-off-by: Eylon Malin --- 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; fun getAllTemplatesServiceModelIds(): Set { - val allTemplatesInfo = - dataAccessService.getList(ServiceInfo::class.java, filterByInstantiateActionStatus(), null, null) as List - - return allTemplatesInfo - .map { it.serviceModelId } - .toHashSet() + val allTemplatesServiceModelID: List = + dataAccessService.executeQuery( + "select distinct serviceModelId from ServiceInfo ${filterByInstantiateActionStatus()}", + null) as List + return allTemplatesServiceModelID.toHashSet() } }