0c54baa4df0adb5009c3ca0151eb698cfb9ac0dc
[cps.git] / cps-ri / src / main / java / org / onap / cps / spi / entities / YangResourceEntity.java
1 /*
2  *  ============LICENSE_START=======================================================
3  *  Copyright (C) 2020 Pantheon.tech
4  *  Modifications Copyright (C) 2021-2023 Nordix Foundation
5  *  ================================================================================
6  *  Licensed under the Apache License, Version 2.0 (the "License");
7  *  you may not use this file except in compliance with the License.
8  *  You may obtain a copy of the License at
9  *
10  *        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.
16  *
17  *  SPDX-License-Identifier: Apache-2.0
18  *  ============LICENSE_END=========================================================
19  */
20
21 package org.onap.cps.spi.entities;
22
23 import jakarta.persistence.Column;
24 import jakarta.persistence.Entity;
25 import jakarta.persistence.GeneratedValue;
26 import jakarta.persistence.GenerationType;
27 import jakarta.persistence.Id;
28 import jakarta.persistence.ManyToMany;
29 import jakarta.persistence.Table;
30 import jakarta.validation.constraints.NotNull;
31 import java.io.Serializable;
32 import java.util.Set;
33 import lombok.Getter;
34 import lombok.NoArgsConstructor;
35 import lombok.Setter;
36
37 /**
38  * Entity to store a Yang files.
39  */
40 @Getter
41 @Setter
42 @NoArgsConstructor
43 @Entity
44 @Table(name = "yang_resource")
45 public class YangResourceEntity implements Serializable {
46
47     private static final long serialVersionUID = -4496883162142106774L;
48
49     @Id
50     @GeneratedValue(strategy = GenerationType.IDENTITY)
51     private Integer id;
52
53     @NotNull
54     @Column
55     private String checksum;
56
57     @NotNull
58     @Column
59     private String fileName;
60
61     @NotNull
62     @Column
63     private String content;
64
65     @NotNull
66     @Column
67     private String moduleName;
68
69     @Column
70     private String revision;
71
72     @ManyToMany(mappedBy = "yangResources")
73     private Set<SchemaSetEntity> schemaSets;
74
75 }