From b62aabac76abe92f04e0991157292c276d3d9177 Mon Sep 17 00:00:00 2001 From: Oleg Mitsura Date: Fri, 15 Jan 2021 13:49:25 -0500 Subject: PV/PVC elimination Issue-ID: CCSDK-3086 1. initial commit 2. fix accidental paste / rebased cleaned up unneeded validation call in cmd-exec upload Signed-off-by: Oleg Mitsura Change-Id: Ife5460c5be59aa8d8592d82099b27c507b08c6c6 --- .../db/primary/domain/BlueprintModelSearch.kt | 2 +- .../db/primary/repository/BlueprintModelRepository.kt | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'ms/blueprintsprocessor/modules/commons/db-lib/src') diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/domain/BlueprintModelSearch.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/domain/BlueprintModelSearch.kt index 734bf3689..ba9051898 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/domain/BlueprintModelSearch.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/domain/BlueprintModelSearch.kt @@ -104,6 +104,6 @@ class BlueprintModelSearch : Serializable { companion object { - const val serialversionuid = 1L + const val serialVersionUID = 1L } } diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/repository/BlueprintModelRepository.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/repository/BlueprintModelRepository.kt index a7891f6a7..a6f0da1cc 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/repository/BlueprintModelRepository.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/repository/BlueprintModelRepository.kt @@ -20,6 +20,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository import org.jetbrains.annotations.NotNull import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.domain.BlueprintModel import org.springframework.data.jpa.repository.JpaRepository +import org.springframework.data.jpa.repository.Query +import org.springframework.data.repository.query.Param import org.springframework.stereotype.Repository import java.util.Optional import javax.transaction.Transactional @@ -47,6 +49,16 @@ interface BlueprintModelRepository : JpaRepository { */ fun findByArtifactNameAndArtifactVersion(artifactName: String, artifactVersion: String): BlueprintModel? + /** + * Find the Blueprint UUID (blueprint_model_id) for a given artifactName/Version + * + * @param artifactName artifactName + * @param artifactVersion artifactVersion + * @return String? + */ + @Query("SELECT m.id FROM BlueprintModel m WHERE m.artifactName = :artifactName AND m.artifactVersion = :artifactVersion") + fun findIdByArtifactNameAndArtifactVersion(@Param("artifactName") artifactName: String, @Param("artifactVersion") artifactVersion: String): String? + /** * This is a findTopByArtifactNameOrderByArtifactIdDesc method * -- cgit 1.2.3-korg