Controller Blueprints MS
[ccsdk/cds.git] / ms / controllerblueprints / modules / service / src / main / java / org / onap / ccsdk / apps / controllerblueprints / service / domain / ModelType.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 org.springframework.data.annotation.LastModifiedDate;\r
20 import org.springframework.data.jpa.domain.support.AuditingEntityListener;\r
21 \r
22 import javax.persistence.*;\r
23 import javax.validation.constraints.NotNull;\r
24 import java.io.Serializable;\r
25 import java.util.Date;\r
26 \r
27 \r
28 /**\r
29  * AsdcReference.java Purpose: Provide Configuration Generator AsdcReference Entity\r
30  *\r
31  * @author Brinda Santh\r
32  * @version 1.0\r
33  */\r
34 @EntityListeners({AuditingEntityListener.class})\r
35 @Entity\r
36 @Table(name = "MODEL_TYPE")\r
37 public class ModelType implements Serializable {\r
38     private static final long serialVersionUID = 1L;\r
39 \r
40     @Id\r
41     @NotNull\r
42     @Column(name = "model_name", nullable = false)\r
43     private String modelName;\r
44 \r
45     @NotNull\r
46     @Column(name = "derived_from")\r
47     private String derivedFrom;\r
48 \r
49     @NotNull\r
50     @Column(name = "definition_type")\r
51     private String definitionType;\r
52 \r
53     @NotNull\r
54     @Lob\r
55     @Column(name = "definition")\r
56     private String definition;\r
57 \r
58     @NotNull\r
59     @Lob\r
60     @Column(name = "description")\r
61     private String description;\r
62 \r
63     @NotNull\r
64     @Column(name = "version")\r
65     private String version;\r
66 \r
67     @NotNull\r
68     @Lob\r
69     @Column(name = "tags")\r
70     private String tags;\r
71 \r
72     // @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "MM/dd/yyyy KK:mm:ss a Z")\r
73     @LastModifiedDate\r
74     @Temporal(TemporalType.TIMESTAMP)\r
75     @Column(name = "creation_date")\r
76     private Date creationDate;\r
77 \r
78     @NotNull\r
79     @Column(name = "updated_by")\r
80     private String updatedBy;\r
81 \r
82     @Override\r
83     public String toString() {\r
84         StringBuilder buffer = new StringBuilder("[");\r
85         buffer.append(", modelName = " + modelName);\r
86         buffer.append(", derivedFrom = " + derivedFrom);\r
87         buffer.append(", definitionType = " + definitionType);\r
88         buffer.append(", description = " + description);\r
89         buffer.append(", creationDate = " + creationDate);\r
90         buffer.append(", version = " + version);\r
91         buffer.append(", updatedBy = " + updatedBy);\r
92         buffer.append(", tags = " + tags);\r
93         buffer.append("]");\r
94         return buffer.toString();\r
95     }\r
96 \r
97     public String getModelName() {\r
98         return modelName;\r
99     }\r
100 \r
101     public void setModelName(String modelName) {\r
102         this.modelName = modelName;\r
103     }\r
104 \r
105     public String getDerivedFrom() {\r
106         return derivedFrom;\r
107     }\r
108 \r
109     public void setDerivedFrom(String derivedFrom) {\r
110         this.derivedFrom = derivedFrom;\r
111     }\r
112 \r
113     public String getDefinitionType() {\r
114         return definitionType;\r
115     }\r
116 \r
117     public void setDefinitionType(String definitionType) {\r
118         this.definitionType = definitionType;\r
119     }\r
120 \r
121     public String getDefinition() {\r
122         return definition;\r
123     }\r
124 \r
125     public void setDefinition(String definition) {\r
126         this.definition = definition;\r
127     }\r
128 \r
129     public String getDescription() {\r
130         return description;\r
131     }\r
132 \r
133     public void setDescription(String description) {\r
134         this.description = description;\r
135     }\r
136 \r
137     public String getVersion() {\r
138         return version;\r
139     }\r
140 \r
141     public void setVersion(String version) {\r
142         this.version = version;\r
143     }\r
144 \r
145     public String getTags() {\r
146         return tags;\r
147     }\r
148 \r
149     public void setTags(String tags) {\r
150         this.tags = tags;\r
151     }\r
152 \r
153     public Date getCreationDate() {\r
154         return creationDate;\r
155     }\r
156 \r
157     public void setCreationDate(Date creationDate) {\r
158         this.creationDate = creationDate;\r
159     }\r
160 \r
161     public String getUpdatedBy() {\r
162         return updatedBy;\r
163     }\r
164 \r
165     public void setUpdatedBy(String updatedBy) {\r
166         this.updatedBy = updatedBy;\r
167     }\r
168 \r
169 \r
170 }\r