2 * Copyright © 2017-2018 AT&T Intellectual Property.
3 * Modifications Copyright © 2019 Bell Canada.
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.jetbrains.annotations.NotNull
21 import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.domain.BlueprintModel
22 import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.domain.BlueprintModelContent
23 import org.springframework.data.jpa.repository.JpaRepository
24 import org.springframework.stereotype.Repository
25 import java.util.Optional
29 * @param <B> ModelContent
32 interface BlueprintModelContentRepository : JpaRepository<BlueprintModelContent, String> {
35 * This is a findById method
41 override fun findById(@NotNull id: String): Optional<BlueprintModelContent>
44 * This is a findTopByBlueprintModelAndContentType method
46 * @param blueprintModel blueprintModel
47 * @param contentType contentType
50 fun findTopByBlueprintModelAndContentType(blueprintModel: BlueprintModel, contentType: String):
51 BlueprintModelContent?
54 * This is a findByBlueprintModelAndContentType method
56 * @param blueprintModel blueprintModel
57 * @param contentType contentType
60 fun findByBlueprintModelAndContentType(blueprintModel: BlueprintModel, contentType: String):
61 List<BlueprintModelContent>
64 * This is a findByBlueprintModel method
66 * @param blueprintModel T
69 fun findByBlueprintModel(blueprintModel: BlueprintModel): List<BlueprintModelContent>
72 * This is a findByBlueprintModelAndContentTypeAndName method
74 * @param blueprintModel blueprintModel
75 * @param contentType contentType
79 fun findByBlueprintModelAndContentTypeAndName(
80 blueprintModel: BlueprintModel,
83 ): BlueprintModelContent?
86 * This is a deleteByMdeleteByBlueprintModelodelName method
88 * @param blueprintModel T
90 fun deleteByBlueprintModel(blueprintModel: BlueprintModel)
93 * This is a deleteById method
97 override fun deleteById(@NotNull id: String)