X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cps-ri%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fcps%2Fspi%2Frepository%2FFragmentRepository.java;h=b1a89923708d5f47a36aac2a014726261ab34587;hb=008c0adc3712ba0aee6410e8cd7efc61f4cbeeac;hp=ba83f15881bee6beca11a6fd876a65f023590b50;hpb=11fd57a2a13c7c34e219c6be24793871bee58ca3;p=cps.git diff --git a/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepository.java b/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepository.java index ba83f1588..b1a899237 100755 --- a/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepository.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepository.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2020 Nordix Foundation. All rights reserved. + * Modifications Copyright (C) 2020 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +21,18 @@ package org.onap.cps.spi.repository; +import java.util.Collection; +import org.onap.cps.spi.entities.Dataspace; import org.onap.cps.spi.entities.Fragment; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface FragmentRepository extends JpaRepository { + + default Collection findFragmentsThatAreAnchorsByDataspace(Dataspace dataspace) { + return findFragmentsByDataspaceAndParentFragmentIsNull(dataspace); + } + + Collection findFragmentsByDataspaceAndParentFragmentIsNull(Dataspace dataspace); } \ No newline at end of file