2 * Copyright © 2019 IBM.
3 * Modifications Copyright © 2019 Orange.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 package org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository
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
27 * Provide Configuration Generator AsdcArtifactsRepository
29 * @author Brinda Santh
33 interface BlueprintModelSearchRepository : JpaRepository<BlueprintModelSearch, Long> {
36 * This is a findById method
39 * @return Optional<BlueprintModelSearch>
40 </BlueprintModelSearch> */
41 fun findById(id: String): BlueprintModelSearch?
44 * This is a findAll method
45 * @return List<BlueprintModelSearch>
46 </BlueprintModelSearch> */
47 override fun findAll(): List<BlueprintModelSearch>
50 * This is a findByArtifactNameAndArtifactVersion method
52 * @param artifactName artifactName
53 * @param artifactVersion artifactVersion
54 * @return Optional<AsdcArtifacts>
56 fun findByArtifactNameAndArtifactVersion(artifactName: String, artifactVersion: String): BlueprintModelSearch?
59 * This is a findByTagsContainingIgnoreCase method
62 * @return Optional<BlueprintModelSearch>
63 </BlueprintModelSearch> */
64 fun findByTagsContainingIgnoreCase(tags: String): List<BlueprintModelSearch>
67 * This is a findby some attributes method
69 * @author Shaaban Ebrahim
74 * @param artifactVersion
76 * @return Optional<BlueprintModelSearch>
77 </BlueprintModelSearch>
79 fun findByUpdatedByOrTagsOrOrArtifactNameOrOrArtifactVersionOrArtifactType(
83 artifactVersion: String,
85 ): List<BlueprintModelSearch>
88 * This is a findby some attributes method
90 * @author Shaaban Ebrahim
95 * @param artifactVersion
98 * @return Page<BlueprintModelSearch>
100 fun findByUpdatedByContainingIgnoreCaseOrTagsContainingIgnoreCaseOrArtifactNameContainingIgnoreCaseOrArtifactVersionContainingIgnoreCaseOrArtifactTypeContainingIgnoreCase(
103 artifactName: String,
104 artifactVersion: String,
105 artifactType: String,
106 pageRequest: Pageable
107 ): Page<BlueprintModelSearch>