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.JsonBackReference;
\r
20 import com.fasterxml.jackson.annotation.JsonFormat;
\r
21 import io.swagger.annotations.ApiModelProperty;
\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.util.Date;
\r
27 import java.util.Objects;
\r
30 * DataDictionary.java Purpose: Provide Configuration Generator DataDictionary Entity
\r
32 * @author Brinda Santh
\r
35 @EntityListeners({AuditingEntityListener.class})
\r
37 @Table(name = "CONFIG_MODEL_CONTENT")
\r
38 public class ConfigModelContent {
\r
40 private static final long serialVersionUID = 1L;
\r
43 @GeneratedValue(strategy = GenerationType.IDENTITY)
\r
44 @Column(name = "config_model_content_id")
\r
47 @Column(name = "name", nullable = false)
\r
48 @ApiModelProperty(required=true)
\r
49 private String name;
\r
51 @Column(name = "content_type", nullable = false)
\r
52 @ApiModelProperty(required=true)
\r
53 private String contentType;
\r
57 @JoinColumn(name = "config_model_id")
\r
59 private ConfigModel configModel;
\r
62 @Column(name = "description")
\r
63 private String description;
\r
66 @Column(name = "content", nullable = false)
\r
67 @ApiModelProperty(required=true)
\r
68 private String content;
\r
71 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
\r
73 @Temporal(TemporalType.TIMESTAMP)
\r
74 @Column(name = "updated_date")
\r
75 private Date creationDate;
\r
78 public String toString() {
\r
79 return "[" + "id = " + id +
\r
80 ", name = " + name +
\r
81 ", contentType = " + contentType +
\r
86 public boolean equals(Object o) {
\r
91 if (!(o instanceof ConfigModelContent)) {
\r
94 ConfigModelContent configModelContent = (ConfigModelContent) o;
\r
95 return Objects.equals(id, configModelContent.id) && Objects.equals(name, configModelContent.name)
\r
96 && Objects.equals(contentType, configModelContent.contentType);
\r
100 public int hashCode() {
\r
101 return Objects.hash(id, name, contentType);
\r
104 public Long getId() {
\r
109 public void setId(Long id) {
\r
114 public String getName() {
\r
119 public void setName(String name) {
\r
124 public String getContentType() {
\r
125 return contentType;
\r
129 public void setContentType(String contentType) {
\r
130 this.contentType = contentType;
\r
134 public ConfigModel getConfigModel() {
\r
135 return configModel;
\r
139 public void setConfigModel(ConfigModel configModel) {
\r
140 this.configModel = configModel;
\r
144 public String getDescription() {
\r
145 return description;
\r
149 public void setDescription(String description) {
\r
150 this.description = description;
\r
154 public String getContent() {
\r
159 public void setContent(String content) {
\r
160 this.content = content;
\r
164 public Date getCreationDate() {
\r
165 return creationDate;
\r
169 public void setCreationDate(Date creationDate) {
\r
170 this.creationDate = creationDate;
\r