2 * Copyright © 2017-2018 AT&T Intellectual Property.
\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
8 * http://www.apache.org/licenses/LICENSE-2.0
\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
17 package org.onap.ccsdk.apps.controllerblueprints.service.domain;
\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
25 import javax.persistence.*;
\r
26 import java.io.Serializable;
\r
27 import java.util.Date;
\r
30 * DataDictionary.java Purpose: Provide Configuration Generator DataDictionary Entity
\r
32 * @author Brinda Santh
\r
35 @EntityListeners({AuditingEntityListener.class})
\r
37 @Table(name = "RESOURCE_DICTIONARY")
\r
38 public class ResourceDictionary implements Serializable {
\r
39 private static final long serialVersionUID = 1L;
\r
42 @Column(name = "name", nullable = false)
\r
43 @ApiModelProperty(required=true)
\r
44 private String name;
\r
46 @Column(name = "resource_path", nullable = false)
\r
47 @ApiModelProperty(required=true)
\r
48 private String resourcePath;
\r
50 @Column(name = "resource_type", nullable = false)
\r
51 @ApiModelProperty(required=true)
\r
52 private String resourceType;
\r
54 @Column(name = "data_type", nullable = false)
\r
55 @ApiModelProperty(required=true)
\r
56 private String dataType;
\r
58 @Column(name = "entry_schema")
\r
59 private String entrySchema;
\r
62 @Column(name = "valid_values")
\r
63 private String validValues;
\r
66 @Column(name = "sample_value")
\r
67 private String sampleValue;
\r
70 @Convert(converter = JpaResourceDefinitionConverter.class)
\r
71 @Column(name = "definition", nullable = false)
\r
72 @ApiModelProperty(required=true)
\r
73 private ResourceDefinition definition;
\r
76 @Column(name = "description", nullable = false)
\r
77 @ApiModelProperty(required=true)
\r
78 private String description;
\r
81 @Column(name = "tags", nullable = false)
\r
82 @ApiModelProperty(required=true)
\r
83 private String tags;
\r
85 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
\r
87 @Temporal(TemporalType.TIMESTAMP)
\r
88 @Column(name = "creation_date")
\r
89 private Date creationDate;
\r
91 @Column(name = "updated_by", nullable = false)
\r
92 @ApiModelProperty(required=true)
\r
93 private String updatedBy;
\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
112 public String getResourcePath() {
\r
113 return resourcePath;
\r
116 public void setResourcePath(String resourcePath) {
\r
117 this.resourcePath = resourcePath;
\r
120 public String getName() {
\r
124 public void setName(String name) {
\r
128 public String getResourceType() {
\r
129 return resourceType;
\r
132 public void setResourceType(String resourceType) {
\r
133 this.resourceType = resourceType;
\r
136 public String getDataType() {
\r
140 public void setDataType(String dataType) {
\r
141 this.dataType = dataType;
\r
144 public String getEntrySchema() {
\r
145 return entrySchema;
\r
148 public void setEntrySchema(String entrySchema) {
\r
149 this.entrySchema = entrySchema;
\r
152 public String getValidValues() {
\r
153 return validValues;
\r
156 public void setValidValues(String validValues) {
\r
157 this.validValues = validValues;
\r
160 public String getSampleValue() {
\r
161 return sampleValue;
\r
164 public void setSampleValue(String sampleValue) {
\r
165 this.sampleValue = sampleValue;
\r
168 public ResourceDefinition getDefinition() {
\r
172 public void setDefinition(ResourceDefinition definition) {
\r
173 this.definition = definition;
\r
176 public String getDescription() {
\r
177 return description;
\r
180 public void setDescription(String description) {
\r
181 this.description = description;
\r
184 public String getTags() {
\r
188 public void setTags(String tags) {
\r
192 public Date getCreationDate() {
\r
193 return creationDate;
\r
196 public void setCreationDate(Date creationDate) {
\r
197 this.creationDate = creationDate;
\r
200 public String getUpdatedBy() {
\r
204 public void setUpdatedBy(String updatedBy) {
\r
205 this.updatedBy = updatedBy;
\r