8beea716177e5f96dce064bf35d9cabe355586c7
[ccsdk/cds.git] /
1 /*
2  * Copyright © 2017-2018 AT&T Intellectual Property.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.repository
18
19 import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.domain.ModelType
20 import org.springframework.data.jpa.repository.JpaRepository
21 import org.springframework.stereotype.Repository
22 import javax.transaction.Transactional
23
24 @Repository
25 interface ModelTypeRepository : JpaRepository<ModelType, String> {
26
27     /**
28      * This is a findByModelName method
29      *
30      * @param modelName Model Name
31      * @return Optional<ModelType>
32      */
33     fun findByModelName(modelName: String): ModelType?
34
35     /**
36      * This is a findByModelNameIn method
37      *
38      * @param modelNames Model Names
39      * @return List<ModelType>
40      */
41     fun findByModelNameIn(modelNames: List<String>): List<ModelType>
42
43     /**
44      * This is a findByDerivedFrom method
45      *
46      * @param derivedFrom Derived From
47      * @return List<ModelType>
48      */
49     fun findByDerivedFrom(derivedFrom: String): List<ModelType>
50
51     /**
52      * This is a findByDerivedFromIn method
53      *
54      * @param derivedFroms Derived Froms
55      * @return List<ModelType>
56      */
57     fun findByDerivedFromIn(derivedFroms: List<String>): List<ModelType>
58
59     /**
60      * This is a findByDefinitionType method
61      *
62      * @param definitionType Definition Type
63      * @return List<ModelType>
64      */
65     fun findByDefinitionType(definitionType: String): List<ModelType>
66
67     /**
68      * This is a findByDefinitionTypeIn method
69      *
70      * @param definitionTypes Definition Types
71      * @return List<ModelType>
72      */
73     fun findByDefinitionTypeIn(definitionTypes: List<String>): List<ModelType>
74
75     /**
76      * This is a findByTagsContainingIgnoreCase method
77      *
78      * @param tags Tags
79      * @return Optional<ModelType>
80      */
81     fun findByTagsContainingIgnoreCase(tags: String): List<ModelType>
82
83     /**
84      * This is a deleteByModelName method
85      *
86      * @param modelName ModelName
87      */
88     @Transactional
89     fun deleteByModelName(modelName: String)
90 }