diff options
author | Eylon Malin <eylon.malin@intl.att.com> | 2020-01-02 10:13:06 +0200 |
---|---|---|
committer | Eylon Malin <eylon.malin@intl.att.com> | 2020-01-02 11:47:34 +0200 |
commit | 6ae9e37abf54b9eb311d9705746d4203055cb97a (patch) | |
tree | 6c5c0c8afbe32122069d15d43d6d3db48f646781 /vid-app-common/src | |
parent | 35b7ca9ee576ef384d8290989cb1207f9601afe7 (diff) |
improve getAllTemplatesServiceModelIds query
Issue-ID: VID-739
Change-Id: I0b5520e0d22942a84ca5d6fc54821455ef67f644
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Diffstat (limited to 'vid-app-common/src')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/dal/AsyncInstantiationRepository.kt | 11 |
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() } } |