diff options
Diffstat (limited to 'mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java')
-rw-r--r-- | mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java index b73896ac5c..fb5f202cbc 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java @@ -20,11 +20,28 @@ package org.onap.so.db.catalog.data.repository; +import java.util.List; import org.onap.so.db.catalog.beans.Workflow; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "workflow", path = "workflow") public interface WorkflowRepository extends JpaRepository<Workflow, String> { + Workflow findByArtifactUUID(String artifactUUID); + + /** + * Used to fetch the @{link Workflow} by the Model UUID. + * + * This operation is required by {@link org.onap.so.db.catalog.client.CatalogDbClient} to provide Workflow based on + * model UUID without projection. + * + * @param vnfResourceModelUUIDmodel UUID + * @return List of Workflow + */ + @Query(value = "select b.* from vnf_resource_to_workflow a join workflow b where a.WORKFLOW_ID = b.ID and a.VNF_RESOURCE_MODEL_UUID = ?1", + nativeQuery = true) + List<Workflow> findWorkflowByModelUUID(String vnfResourceModelUUID); } |