7af9972a66fb2cb2a6f8b3a06814c77be56ea128
[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.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceDefinition;\r
22 import org.springframework.data.annotation.LastModifiedDate;\r
23 import org.springframework.data.jpa.domain.support.AuditingEntityListener;\r
24 \r
25 import javax.persistence.*;\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     @Column(name = "name", nullable = false)\r
43     @ApiModelProperty(required=true)\r
44     private String name;\r
45 \r
46     @Column(name = "resource_path", nullable = false)\r
47     @ApiModelProperty(required=true)\r
48     private String resourcePath;\r
49 \r
50     @Column(name = "resource_type", nullable = false)\r
51     @ApiModelProperty(required=true)\r
52     private String resourceType;\r
53 \r
54     @Column(name = "data_type", nullable = false)\r
55     @ApiModelProperty(required=true)\r
56     private String dataType;\r
57 \r
58     @Column(name = "entry_schema")\r
59     private String entrySchema;\r
60 \r
61     @Lob\r
62     @Column(name = "valid_values")\r
63     private String validValues;\r
64 \r
65     @Lob\r
66     @Column(name = "sample_value")\r
67     private String sampleValue;\r
68 \r
69     @Lob\r
70     @Convert(converter  = JpaResourceDefinitionConverter.class)\r
71     @Column(name = "definition", nullable = false)\r
72     @ApiModelProperty(required=true)\r
73     private ResourceDefinition definition;\r
74 \r
75     @Lob\r
76     @Column(name = "description", nullable = false)\r
77     @ApiModelProperty(required=true)\r
78     private String description;\r
79 \r
80     @Lob\r
81     @Column(name = "tags", nullable = false)\r
82     @ApiModelProperty(required=true)\r
83     private String tags;\r
84 \r
85     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")\r
86     @LastModifiedDate\r
87     @Temporal(TemporalType.TIMESTAMP)\r
88     @Column(name = "creation_date")\r
89     private Date creationDate;\r
90 \r
91     @Column(name = "updated_by", nullable = false)\r
92     @ApiModelProperty(required=true)\r
93     private String updatedBy;\r
94 \r
95     @Override\r
96     public String toString() {\r
97         String buffer = "[" + ", name = " + name +\r
98                 ", resourcePath = " + resourcePath +\r
99                 ", resourceType = " + resourceType +\r
100                 ", dataType = " + dataType +\r
101                 ", entrySchema = " + entrySchema +\r
102                 ", validValues = " + validValues +\r
103                 ", definition =" + definition +\r
104                 ", description = " + description +\r
105                 ", updatedBy = " + updatedBy +\r
106                 ", tags = " + tags +\r
107                 ", creationDate = " + creationDate +\r
108                 "]";\r
109         return buffer;\r
110     }\r
111 \r
112     public String getResourcePath() {\r
113         return resourcePath;\r
114     }\r
115 \r
116     public void setResourcePath(String resourcePath) {\r
117         this.resourcePath = resourcePath;\r
118     }\r
119 \r
120     public String getName() {\r
121         return name;\r
122     }\r
123 \r
124     public void setName(String name) {\r
125         this.name = name;\r
126     }\r
127 \r
128     public String getResourceType() {\r
129         return resourceType;\r
130     }\r
131 \r
132     public void setResourceType(String resourceType) {\r
133         this.resourceType = resourceType;\r
134     }\r
135 \r
136     public String getDataType() {\r
137         return dataType;\r
138     }\r
139 \r
140     public void setDataType(String dataType) {\r
141         this.dataType = dataType;\r
142     }\r
143 \r
144     public String getEntrySchema() {\r
145         return entrySchema;\r
146     }\r
147 \r
148     public void setEntrySchema(String entrySchema) {\r
149         this.entrySchema = entrySchema;\r
150     }\r
151 \r
152     public String getValidValues() {\r
153         return validValues;\r
154     }\r
155 \r
156     public void setValidValues(String validValues) {\r
157         this.validValues = validValues;\r
158     }\r
159 \r
160     public String getSampleValue() {\r
161         return sampleValue;\r
162     }\r
163 \r
164     public void setSampleValue(String sampleValue) {\r
165         this.sampleValue = sampleValue;\r
166     }\r
167 \r
168     public ResourceDefinition getDefinition() {\r
169         return definition;\r
170     }\r
171 \r
172     public void setDefinition(ResourceDefinition definition) {\r
173         this.definition = definition;\r
174     }\r
175 \r
176     public String getDescription() {\r
177         return description;\r
178     }\r
179 \r
180     public void setDescription(String description) {\r
181         this.description = description;\r
182     }\r
183 \r
184     public String getTags() {\r
185         return tags;\r
186     }\r
187 \r
188     public void setTags(String tags) {\r
189         this.tags = tags;\r
190     }\r
191 \r
192     public Date getCreationDate() {\r
193         return creationDate;\r
194     }\r
195 \r
196     public void setCreationDate(Date creationDate) {\r
197         this.creationDate = creationDate;\r
198     }\r
199 \r
200     public String getUpdatedBy() {\r
201         return updatedBy;\r
202     }\r
203 \r
204     public void setUpdatedBy(String updatedBy) {\r
205         this.updatedBy = updatedBy;\r
206     }\r
207 \r
208 \r
209 \r
210 }\r