5c7a94034658cf12fb796577effb8b5ce16b1c46
[ccsdk/cds.git] /
1 /*
2  *  Copyright © 2019 IBM.
3  *  Modifications Copyright © 2019 Orange.
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  */
17
18 package org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository
19
20 import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.domain.BlueprintModelSearch
21 import org.springframework.data.domain.Page
22 import org.springframework.data.domain.PageRequest
23 import org.springframework.data.domain.Pageable
24 import org.springframework.data.jpa.repository.JpaRepository
25 import org.springframework.stereotype.Repository
26
27 /**
28  * Provide Configuration Generator AsdcArtifactsRepository
29  *
30  * @author Brinda Santh
31  * @version 1.0
32  */
33 @Repository
34 interface BlueprintModelSearchRepository : JpaRepository<BlueprintModelSearch, Long> {
35
36     /**
37      * This is a findById method
38      *
39      * @param id id
40      * @return Optional<BlueprintModelSearch>
41     </BlueprintModelSearch> */
42     fun findById(id: String): BlueprintModelSearch?
43
44     /**
45      * This is a findAll method
46      * @return List<BlueprintModelSearch>
47     </BlueprintModelSearch> */
48     override fun findAll(): List<BlueprintModelSearch>
49
50     /**
51      * This is a findByArtifactNameAndArtifactVersion method
52      *
53      * @param artifactName artifactName
54      * @param artifactVersion artifactVersion
55      * @return Optional<AsdcArtifacts>
56     </AsdcArtifacts> */
57     fun findByArtifactNameAndArtifactVersion(artifactName: String, artifactVersion: String): BlueprintModelSearch?
58
59     /**
60      * This is a findByTagsContainingIgnoreCase method
61      *
62      * @param tags
63      * @return Optional<BlueprintModelSearch>
64     </BlueprintModelSearch> */
65     fun findByTagsContainingIgnoreCase(tags: String): List<BlueprintModelSearch>
66
67     /**
68      * This is a findby some attributes method
69      *
70      * @author Shaaban Ebrahim
71      *
72      * @param updatedBy
73      * @param tags
74      * @param artifactName
75      * @param artifactVersion
76      * @param artifactType
77      * @return Optional<BlueprintModelSearch>
78     </BlueprintModelSearch>
79      */
80     fun findByUpdatedByOrTagsOrOrArtifactNameOrOrArtifactVersionOrArtifactType(updatedBy: String, tags: String, artifactName: String, artifactVersion: String,
81                                                                                artifactType: String): List<BlueprintModelSearch>
82
83
84     /**
85      * This is a findby some attributes method
86      *
87      * @author Shaaban Ebrahim
88      *
89      * @param updatedBy
90      * @param tags
91      * @param artifactName
92      * @param artifactVersion
93      * @param artifactType
94      * @param pageRequest
95      * @return Page<BlueprintModelSearch>
96      */
97     fun findByUpdatedByOrTagsOrOrArtifactNameOrOrArtifactVersionOrArtifactType(updatedBy: String, tags: String, artifactName: String, artifactVersion: String,
98                                                                                artifactType: String,pageRequest: Pageable): Page<BlueprintModelSearch>
99
100
101
102
103 }