From 6ae9e37abf54b9eb311d9705746d4203055cb97a Mon Sep 17 00:00:00 2001 From: Eylon Malin Date: Thu, 2 Jan 2020 10:13:06 +0200 Subject: improve getAllTemplatesServiceModelIds query Issue-ID: VID-739 Change-Id: I0b5520e0d22942a84ca5d6fc54821455ef67f644 Signed-off-by: Eylon Malin --- .../java/org/onap/vid/dal/AsyncInstantiationRepository.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'vid-app-common/src') 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() } } -- cgit 1.2.3-korg