Few Sonar Fixes
[cps.git] / cps-ri / src / main / java / org / onap / cps / spi / repository / FragmentRepository.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  *  Copyright (C) 2020 Nordix Foundation. All rights reserved.\r
4  *  Modifications Copyright (C) 2020 Bell Canada. All rights reserved.\r
5  * ================================================================================\r
6  * Licensed under the Apache License, Version 2.0 (the "License");\r
7  * you may not use this file except in compliance with the License.\r
8  * You may obtain a copy of the License at\r
9  *\r
10  *      http://www.apache.org/licenses/LICENSE-2.0\r
11  *\r
12  * Unless required by applicable law or agreed to in writing, software\r
13  * distributed under the License is distributed on an "AS IS" BASIS,\r
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
15  * See the License for the specific language governing permissions and\r
16  * limitations under the License.\r
17  *\r
18  * SPDX-License-Identifier: Apache-2.0\r
19  * ============LICENSE_END=========================================================\r
20  */\r
21 \r
22 package org.onap.cps.spi.repository;\r
23 \r
24 import java.util.Collection;\r
25 import org.onap.cps.spi.entities.Dataspace;\r
26 import org.onap.cps.spi.entities.Fragment;\r
27 import org.springframework.data.jpa.repository.JpaRepository;\r
28 import org.springframework.stereotype.Repository;\r
29 \r
30 @Repository\r
31 public interface FragmentRepository extends JpaRepository<Fragment, Integer> {\r
32 \r
33     default Collection<Fragment> findFragmentsThatAreAnchorsByDataspace(Dataspace dataspace) {\r
34         return findFragmentsByDataspaceAndParentFragmentIsNull(dataspace);\r
35     }\r
36 \r
37     Collection<Fragment> findFragmentsByDataspaceAndParentFragmentIsNull(Dataspace dataspace);\r
38 }