Migrate "ms/controllerblueprints" from ccsdk/apps
[ccsdk/cds.git] / ms / controllerblueprints / modules / service / src / main / java / org / onap / ccsdk / apps / controllerblueprints / service / domain / ResourceDictionary.java
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         return "[" + ", 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     }\r
91 \r
92     public String getName() {\r
93         return name;\r
94     }\r
95 \r
96     public void setName(String name) {\r
97         this.name = name;\r
98     }\r
99 \r
100     public String getDataType() {\r
101         return dataType;\r
102     }\r
103 \r
104     public void setDataType(String dataType) {\r
105         this.dataType = dataType;\r
106     }\r
107 \r
108     public String getEntrySchema() {\r
109         return entrySchema;\r
110     }\r
111 \r
112     public void setEntrySchema(String entrySchema) {\r
113         this.entrySchema = entrySchema;\r
114     }\r
115 \r
116     public ResourceDefinition getDefinition() {\r
117         return definition;\r
118     }\r
119 \r
120     public void setDefinition(ResourceDefinition definition) {\r
121         this.definition = definition;\r
122     }\r
123 \r
124     public String getDescription() {\r
125         return description;\r
126     }\r
127 \r
128     public void setDescription(String description) {\r
129         this.description = description;\r
130     }\r
131 \r
132     public String getTags() {\r
133         return tags;\r
134     }\r
135 \r
136     public void setTags(String tags) {\r
137         this.tags = tags;\r
138     }\r
139 \r
140     public Date getCreationDate() {\r
141         return creationDate;\r
142     }\r
143 \r
144     public void setCreationDate(Date creationDate) {\r
145         this.creationDate = creationDate;\r
146     }\r
147 \r
148     public String getUpdatedBy() {\r
149         return updatedBy;\r
150     }\r
151 \r
152     public void setUpdatedBy(String updatedBy) {\r
153         this.updatedBy = updatedBy;\r
154     }\r
155 \r
156 \r
157 \r
158 }\r