5986603ca8d9e92324e7bf5dfa5ab2f1b25efec2
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / commons / db-lib / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / db / primary / repository / BlueprintModelSearchRepository.kt
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.Pageable
23 import org.springframework.data.jpa.repository.JpaRepository
24 import org.springframework.stereotype.Repository
25
26 /**
27  * Provide Configuration Generator AsdcArtifactsRepository
28  *
29  * @author Brinda Santh
30  * @version 1.0
31  */
32 @Repository
33 interface BlueprintModelSearchRepository : JpaRepository<BlueprintModelSearch, Long> {
34
35     /**
36      * This is a findById method
37      *
38      * @param id id
39      * @return Optional<BlueprintModelSearch>
40     </BlueprintModelSearch> */
41     fun findById(id: String): BlueprintModelSearch?
42
43     /**
44      * This is a findAll method
45      * @return List<BlueprintModelSearch>
46     </BlueprintModelSearch> */
47     override fun findAll(): List<BlueprintModelSearch>
48
49     /**
50      * This is a findByArtifactNameAndArtifactVersion method
51      *
52      * @param artifactName artifactName
53      * @param artifactVersion artifactVersion
54      * @return Optional<AsdcArtifacts>
55     </AsdcArtifacts> */
56     fun findByArtifactNameAndArtifactVersion(artifactName: String, artifactVersion: String): BlueprintModelSearch?
57
58     /**
59      * This is a findByTagsContainingIgnoreCase method
60      *
61      * @param tags
62      * @return Optional<BlueprintModelSearch>
63     </BlueprintModelSearch> */
64     fun findByTagsContainingIgnoreCase(tags: String): List<BlueprintModelSearch>
65
66     /**
67      * This is a findby some attributes method
68      *
69      * @author Shaaban Ebrahim
70      *
71      * @param updatedBy
72      * @param tags
73      * @param artifactName
74      * @param artifactVersion
75      * @param artifactType
76      * @return Optional<BlueprintModelSearch>
77     </BlueprintModelSearch>
78      */
79     fun findByUpdatedByOrTagsOrOrArtifactNameOrOrArtifactVersionOrArtifactType(
80         updatedBy: String,
81         tags: String,
82         artifactName: String,
83         artifactVersion: String,
84         artifactType: String
85     ): List<BlueprintModelSearch>
86
87     /**
88      * This is a findby some attributes method
89      *
90      * @author Shaaban Ebrahim
91      *
92      * @param updatedBy
93      * @param tags
94      * @param artifactName
95      * @param artifactVersion
96      * @param artifactType
97      * @param pageRequest
98      * @return Page<BlueprintModelSearch>
99      */
100     fun findByUpdatedByContainingIgnoreCaseOrTagsContainingIgnoreCaseOrArtifactNameContainingIgnoreCaseOrArtifactVersionContainingIgnoreCaseOrArtifactTypeContainingIgnoreCase(
101         updatedBy: String,
102         tags: String,
103         artifactName: String,
104         artifactVersion: String,
105         artifactType: String,
106         pageRequest: Pageable
107     ): Page<BlueprintModelSearch>
108 }