Migrate "ms/controllerblueprints" from ccsdk/apps
[ccsdk/cds.git] / ms / controllerblueprints / modules / service / src / main / java / org / onap / ccsdk / cds / controllerblueprints / service / domain / ResourceDictionary.java
1 /*
2  * Copyright © 2017-2018 AT&T Intellectual Property.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.ccsdk.cds.controllerblueprints.service.domain;
18
19 import com.fasterxml.jackson.annotation.JsonFormat;
20 import io.swagger.annotations.ApiModelProperty;
21 import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition;
22 import org.springframework.data.annotation.LastModifiedDate;
23 import org.springframework.data.jpa.domain.support.AuditingEntityListener;
24
25 import javax.persistence.*;
26 import java.io.Serializable;
27 import java.util.Date;
28
29 /**
30  * DataDictionary.java Purpose: Provide Configuration Generator DataDictionary Entity
31  *
32  * @author Brinda Santh
33  * @version 1.0
34  */
35 @EntityListeners({AuditingEntityListener.class})
36 @Entity
37 @Table(name = "RESOURCE_DICTIONARY")
38 public class ResourceDictionary implements Serializable {
39     private static final long serialVersionUID = 1L;
40
41     @Id
42     @Column(name = "name", nullable = false)
43     @ApiModelProperty(required=true)
44     private String name;
45
46     @Column(name = "data_type", nullable = false)
47     @ApiModelProperty(required=true)
48     private String dataType;
49
50     @Column(name = "entry_schema")
51     private String entrySchema;
52
53     @Lob
54     @Convert(converter  = JpaResourceDefinitionConverter.class)
55     @Column(name = "definition", nullable = false)
56     @ApiModelProperty(required=true)
57     private ResourceDefinition definition;
58
59     @Lob
60     @Column(name = "description", nullable = false)
61     @ApiModelProperty(required=true)
62     private String description;
63
64     @Lob
65     @Column(name = "tags", nullable = false)
66     @ApiModelProperty(required=true)
67     private String tags;
68
69     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
70     @LastModifiedDate
71     @Temporal(TemporalType.TIMESTAMP)
72     @Column(name = "creation_date")
73     private Date creationDate;
74
75     @Column(name = "updated_by", nullable = false)
76     @ApiModelProperty(required=true)
77     private String updatedBy;
78
79     @Override
80     public String toString() {
81         return "[" + ", name = " + name +
82                 ", dataType = " + dataType +
83                 ", entrySchema = " + entrySchema +
84                 ", definition =" + definition +
85                 ", description = " + description +
86                 ", updatedBy = " + updatedBy +
87                 ", tags = " + tags +
88                 ", creationDate = " + creationDate +
89                 "]";
90     }
91
92     public String getName() {
93         return name;
94     }
95
96     public void setName(String name) {
97         this.name = name;
98     }
99
100     public String getDataType() {
101         return dataType;
102     }
103
104     public void setDataType(String dataType) {
105         this.dataType = dataType;
106     }
107
108     public String getEntrySchema() {
109         return entrySchema;
110     }
111
112     public void setEntrySchema(String entrySchema) {
113         this.entrySchema = entrySchema;
114     }
115
116     public ResourceDefinition getDefinition() {
117         return definition;
118     }
119
120     public void setDefinition(ResourceDefinition definition) {
121         this.definition = definition;
122     }
123
124     public String getDescription() {
125         return description;
126     }
127
128     public void setDescription(String description) {
129         this.description = description;
130     }
131
132     public String getTags() {
133         return tags;
134     }
135
136     public void setTags(String tags) {
137         this.tags = tags;
138     }
139
140     public Date getCreationDate() {
141         return creationDate;
142     }
143
144     public void setCreationDate(Date creationDate) {
145         this.creationDate = creationDate;
146     }
147
148     public String getUpdatedBy() {
149         return updatedBy;
150     }
151
152     public void setUpdatedBy(String updatedBy) {
153         this.updatedBy = updatedBy;
154     }
155
156
157
158 }