42c8e83b2ae04bd0d5ca748895e2ac5b048c4ee9
[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 = "data_type", nullable = false)\r
47     @ApiModelProperty(required=true)\r
48     private String dataType;\r
49 \r
50     @Column(name = "entry_schema")\r
51     private String entrySchema;\r
52 \r
53     @Lob\r
54     @Convert(converter  = JpaResourceDefinitionConverter.class)\r
55     @Column(name = "definition", nullable = false)\r
56     @ApiModelProperty(required=true)\r
57     private ResourceDefinition definition;\r
58 \r
59     @Lob\r
60     @Column(name = "description", nullable = false)\r
61     @ApiModelProperty(required=true)\r
62     private String description;\r
63 \r
64     @Lob\r
65     @Column(name = "tags", nullable = false)\r
66     @ApiModelProperty(required=true)\r
67     private String tags;\r
68 \r
69     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")\r
70     @LastModifiedDate\r
71     @Temporal(TemporalType.TIMESTAMP)\r
72     @Column(name = "creation_date")\r
73     private Date creationDate;\r
74 \r
75     @Column(name = "updated_by", nullable = false)\r
76     @ApiModelProperty(required=true)\r
77     private String updatedBy;\r
78 \r
79     @Override\r
80     public String toString() {\r
81         String buffer = "[" + ", name = " + name +\r
82                 ", dataType = " + dataType +\r
83                 ", entrySchema = " + entrySchema +\r
84                 ", definition =" + definition +\r
85                 ", description = " + description +\r
86                 ", updatedBy = " + updatedBy +\r
87                 ", tags = " + tags +\r
88                 ", creationDate = " + creationDate +\r
89                 "]";\r
90         return buffer;\r
91     }\r
92 \r
93     public String getName() {\r
94         return name;\r
95     }\r
96 \r
97     public void setName(String name) {\r
98         this.name = name;\r
99     }\r
100 \r
101     public String getDataType() {\r
102         return dataType;\r
103     }\r
104 \r
105     public void setDataType(String dataType) {\r
106         this.dataType = dataType;\r
107     }\r
108 \r
109     public String getEntrySchema() {\r
110         return entrySchema;\r
111     }\r
112 \r
113     public void setEntrySchema(String entrySchema) {\r
114         this.entrySchema = entrySchema;\r
115     }\r
116 \r
117     public ResourceDefinition getDefinition() {\r
118         return definition;\r
119     }\r
120 \r
121     public void setDefinition(ResourceDefinition definition) {\r
122         this.definition = definition;\r
123     }\r
124 \r
125     public String getDescription() {\r
126         return description;\r
127     }\r
128 \r
129     public void setDescription(String description) {\r
130         this.description = description;\r
131     }\r
132 \r
133     public String getTags() {\r
134         return tags;\r
135     }\r
136 \r
137     public void setTags(String tags) {\r
138         this.tags = tags;\r
139     }\r
140 \r
141     public Date getCreationDate() {\r
142         return creationDate;\r
143     }\r
144 \r
145     public void setCreationDate(Date creationDate) {\r
146         this.creationDate = creationDate;\r
147     }\r
148 \r
149     public String getUpdatedBy() {\r
150         return updatedBy;\r
151     }\r
152 \r
153     public void setUpdatedBy(String updatedBy) {\r
154         this.updatedBy = updatedBy;\r
155     }\r
156 \r
157 \r
158 \r
159 }\r