diff options
author | 2024-08-12 11:07:22 +0100 | |
---|---|---|
committer | 2024-08-14 10:12:54 +0100 | |
commit | 7c5744fecbc2067e800cd3bc90acac0e44318ada (patch) | |
tree | 04762cea36d9b8611f159368b0f7143f26ef1336 /models | |
parent | 036e873dea28748ded7a735b2aa3456865643af9 (diff) |
Fix issue using stage in ACM intermediary
Issue-ID: POLICY-5091
Change-Id: I4d96e6472d61c3dfa3de5bfe5c94651b753a95f5
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'models')
-rw-r--r-- | models/src/main/java/org/onap/policy/clamp/models/acm/persistence/repository/AutomationCompositionElementRepository.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/repository/AutomationCompositionElementRepository.java b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/repository/AutomationCompositionElementRepository.java index 19d791e6c..d0a996e20 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/repository/AutomationCompositionElementRepository.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/repository/AutomationCompositionElementRepository.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2023 Nordix Foundation. + * Copyright (C) 2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,14 +20,19 @@ package org.onap.policy.clamp.models.acm.persistence.repository; +import jakarta.persistence.LockModeType; import java.util.List; import org.onap.policy.clamp.models.acm.persistence.concepts.JpaAutomationCompositionElement; import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.repository.query.QueryByExampleExecutor; +import org.springframework.data.jpa.repository.Lock; +import org.springframework.lang.NonNull; -public interface AutomationCompositionElementRepository extends - JpaRepository<JpaAutomationCompositionElement, String>, - QueryByExampleExecutor<JpaAutomationCompositionElement> { +public interface AutomationCompositionElementRepository extends JpaRepository<JpaAutomationCompositionElement, String> { + + @NonNull + @Override + @Lock(LockModeType.PESSIMISTIC_READ) + JpaAutomationCompositionElement getReferenceById(@NonNull String id); List<JpaAutomationCompositionElement> findByParticipantId(String participantId); } |