Migrate "ms/controllerblueprints" from ccsdk/apps
[ccsdk/cds.git] / ms / controllerblueprints / modules / service / src / main / kotlin / org / onap / ccsdk / apps / controllerblueprints / service / repository / ModelTypeRepository.kt
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.apps.controllerblueprints.service.repository
18
19 import org.onap.ccsdk.apps.controllerblueprints.service.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      * This is a findByModelName method
28      *
29      * @param modelName Model Name
30      * @return Optional<ModelType>
31      */
32     fun findByModelName(modelName: String): ModelType?
33     /**
34      * This is a findByModelNameIn method
35      *
36      * @param modelNames Model Names
37      * @return List<ModelType>
38      */
39     fun findByModelNameIn(modelNames: List<String>): List<ModelType>
40     /**
41      * This is a findByDerivedFrom method
42      *
43      * @param derivedFrom Derived From
44      * @return List<ModelType>
45     */
46     fun findByDerivedFrom(derivedFrom: String): List<ModelType>
47     /**
48      * This is a findByDerivedFromIn method
49      *
50      * @param derivedFroms Derived Froms
51      * @return List<ModelType>
52     */
53     fun findByDerivedFromIn(derivedFroms: List<String>): List<ModelType>
54
55     /**
56      * This is a findByDefinitionType method
57      *
58      * @param definitionType Definition Type
59      * @return List<ModelType>
60      */
61     fun findByDefinitionType(definitionType: String): List<ModelType>
62     /**
63      * This is a findByDefinitionTypeIn method
64      *
65      * @param definitionTypes Definition Types
66      * @return List<ModelType>
67     */
68     fun findByDefinitionTypeIn(definitionTypes: List<String>): List<ModelType>
69
70     /**
71      * This is a findByTagsContainingIgnoreCase method
72      *
73      * @param tags Tags
74      * @return Optional<ModelType>
75      */
76     fun findByTagsContainingIgnoreCase(tags: String): List<ModelType>
77
78     /**
79      * This is a deleteByModelName method
80      *
81      * @param modelName ModelName
82      */
83     @Transactional
84     fun deleteByModelName(modelName: String)
85 }