0d5879db86e9287dce2516ff1460648017c3ee9f
[ccsdk/cds.git] /
1 /*\r
2  * Copyright © 2017-2018 AT&T Intellectual Property.\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *     http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 package org.onap.ccsdk.apps.controllerblueprints.service.domain;\r
18 \r
19 import com.fasterxml.jackson.annotation.JsonFormat;\r
20 import io.swagger.annotations.ApiModelProperty;\r
21 import org.springframework.data.annotation.LastModifiedDate;\r
22 import org.springframework.data.jpa.domain.support.AuditingEntityListener;\r
23 \r
24 import javax.persistence.*;\r
25 import javax.validation.constraints.NotNull;\r
26 import java.io.Serializable;\r
27 import java.util.Date;\r
28 \r
29 /**\r
30  * DataDictionary.java Purpose: Provide Configuration Generator DataDictionary Entity\r
31  *\r
32  * @author Brinda Santh\r
33  * @version 1.0\r
34  */\r
35 @EntityListeners({AuditingEntityListener.class})\r
36 @Entity\r
37 @Table(name = "RESOURCE_DICTIONARY")\r
38 public class ResourceDictionary implements Serializable {\r
39     private static final long serialVersionUID = 1L;\r
40 \r
41     @Id\r
42     @NotNull\r
43     @Column(name = "name")\r
44     @ApiModelProperty(required=true)\r
45     private String name;\r
46 \r
47     @NotNull\r
48     @Column(name = "resource_path")\r
49     @ApiModelProperty(required=true)\r
50     private String resourcePath;\r
51 \r
52     @NotNull\r
53     @Column(name = "resource_type")\r
54     @ApiModelProperty(required=true)\r
55     private String resourceType;\r
56 \r
57     @NotNull\r
58     @Column(name = "data_type")\r
59     @ApiModelProperty(required=true)\r
60     private String dataType;\r
61 \r
62     @Column(name = "entry_schema")\r
63     private String entrySchema;\r
64 \r
65     @Lob\r
66     @Column(name = "valid_values")\r
67     private String validValues;\r
68 \r
69     @Lob\r
70     @Column(name = "sample_value")\r
71     private String sampleValue;\r
72 \r
73     @NotNull\r
74     @Lob\r
75     @Column(name = "definition")\r
76     @ApiModelProperty(required=true)\r
77     private String definition;\r
78 \r
79     @NotNull\r
80     @Lob\r
81     @Column(name = "description")\r
82     @ApiModelProperty(required=true)\r
83     private String description;\r
84 \r
85     @NotNull\r
86     @Lob\r
87     @Column(name = "tags")\r
88     @ApiModelProperty(required=true)\r
89     private String tags;\r
90 \r
91     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")\r
92     @LastModifiedDate\r
93     @Temporal(TemporalType.TIMESTAMP)\r
94     @Column(name = "creation_date")\r
95     private Date creationDate;\r
96 \r
97     @NotNull\r
98     @Column(name = "updated_by")\r
99     @ApiModelProperty(required=true)\r
100     private String updatedBy;\r
101 \r
102     @Override\r
103     public String toString() {\r
104         StringBuilder buffer = new StringBuilder("[");\r
105         buffer.append(", name = " + name);\r
106         buffer.append(", resourcePath = " + resourcePath);\r
107         buffer.append(", resourceType = " + resourceType);\r
108         buffer.append(", dataType = " + dataType);\r
109         buffer.append(", entrySchema = " + entrySchema);\r
110         buffer.append(", validValues = " + validValues);\r
111         buffer.append(", definition =" + definition);\r
112         buffer.append(", description = " + description);\r
113         buffer.append(", updatedBy = " + updatedBy);\r
114         buffer.append(", tags = " + tags);\r
115         buffer.append(", creationDate = " + creationDate);\r
116         buffer.append("]");\r
117         return buffer.toString();\r
118     }\r
119 \r
120     public String getResourcePath() {\r
121         return resourcePath;\r
122     }\r
123 \r
124     public void setResourcePath(String resourcePath) {\r
125         this.resourcePath = resourcePath;\r
126     }\r
127 \r
128     public String getName() {\r
129         return name;\r
130     }\r
131 \r
132     public void setName(String name) {\r
133         this.name = name;\r
134     }\r
135 \r
136     public String getResourceType() {\r
137         return resourceType;\r
138     }\r
139 \r
140     public void setResourceType(String resourceType) {\r
141         this.resourceType = resourceType;\r
142     }\r
143 \r
144     public String getDataType() {\r
145         return dataType;\r
146     }\r
147 \r
148     public void setDataType(String dataType) {\r
149         this.dataType = dataType;\r
150     }\r
151 \r
152     public String getEntrySchema() {\r
153         return entrySchema;\r
154     }\r
155 \r
156     public void setEntrySchema(String entrySchema) {\r
157         this.entrySchema = entrySchema;\r
158     }\r
159 \r
160     public String getValidValues() {\r
161         return validValues;\r
162     }\r
163 \r
164     public void setValidValues(String validValues) {\r
165         this.validValues = validValues;\r
166     }\r
167 \r
168     public String getSampleValue() {\r
169         return sampleValue;\r
170     }\r
171 \r
172     public void setSampleValue(String sampleValue) {\r
173         this.sampleValue = sampleValue;\r
174     }\r
175 \r
176     public String getDefinition() {\r
177         return definition;\r
178     }\r
179 \r
180     public void setDefinition(String definition) {\r
181         this.definition = definition;\r
182     }\r
183 \r
184     public String getDescription() {\r
185         return description;\r
186     }\r
187 \r
188     public void setDescription(String description) {\r
189         this.description = description;\r
190     }\r
191 \r
192     public String getTags() {\r
193         return tags;\r
194     }\r
195 \r
196     public void setTags(String tags) {\r
197         this.tags = tags;\r
198     }\r
199 \r
200     public Date getCreationDate() {\r
201         return creationDate;\r
202     }\r
203 \r
204     public void setCreationDate(Date creationDate) {\r
205         this.creationDate = creationDate;\r
206     }\r
207 \r
208     public String getUpdatedBy() {\r
209         return updatedBy;\r
210     }\r
211 \r
212     public void setUpdatedBy(String updatedBy) {\r
213         this.updatedBy = updatedBy;\r
214     }\r
215 \r
216 \r
217 \r
218 }\r