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 javax.validation.constraints.NotNull;
\r
27 import java.util.Date;
\r
28 import java.util.Objects;
\r
31 * DataDictionary.java Purpose: Provide Configuration Generator DataDictionary Entity
\r
33 * @author Brinda Santh
\r
36 @EntityListeners({AuditingEntityListener.class})
\r
38 @Table(name = "CONFIG_MODEL_CONTENT")
\r
39 public class ConfigModelContent {
\r
41 private static final long serialVersionUID = 1L;
\r
44 @GeneratedValue(strategy = GenerationType.IDENTITY)
\r
45 @Column(name = "config_model_content_id")
\r
49 @Column(name = "name")
\r
50 @ApiModelProperty(required=true)
\r
51 private String name;
\r
54 @Column(name = "content_type")
\r
55 @ApiModelProperty(required=true)
\r
56 private String contentType;
\r
60 @JoinColumn(name = "config_model_id")
\r
62 private ConfigModel configModel;
\r
65 @Column(name = "description")
\r
66 private String description;
\r
70 @Column(name = "content")
\r
71 @ApiModelProperty(required=true)
\r
72 private String content;
\r
75 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
\r
77 @Temporal(TemporalType.TIMESTAMP)
\r
78 @Column(name = "updated_date")
\r
79 private Date creationDate;
\r
82 public String toString() {
\r
83 StringBuilder builder = new StringBuilder("[");
\r
84 builder.append("id = " + id);
\r
85 builder.append(", name = " + name);
\r
86 builder.append(", contentType = " + contentType);
\r
87 builder.append("]");
\r
88 return builder.toString();
\r
92 public boolean equals(Object o) {
\r
97 if (!(o instanceof ConfigModelContent)) {
\r
100 ConfigModelContent configModelContent = (ConfigModelContent) o;
\r
101 return Objects.equals(id, configModelContent.id) && Objects.equals(name, configModelContent.name)
\r
102 && Objects.equals(contentType, configModelContent.contentType);
\r
106 public int hashCode() {
\r
107 return Objects.hash(id, name, contentType);
\r
110 public Long getId() {
\r
115 public void setId(Long id) {
\r
120 public String getName() {
\r
125 public void setName(String name) {
\r
130 public String getContentType() {
\r
131 return contentType;
\r
135 public void setContentType(String contentType) {
\r
136 this.contentType = contentType;
\r
140 public ConfigModel getConfigModel() {
\r
141 return configModel;
\r
145 public void setConfigModel(ConfigModel configModel) {
\r
146 this.configModel = configModel;
\r
150 public String getDescription() {
\r
151 return description;
\r
155 public void setDescription(String description) {
\r
156 this.description = description;
\r
160 public String getContent() {
\r
165 public void setContent(String content) {
\r
166 this.content = content;
\r
170 public Date getCreationDate() {
\r
171 return creationDate;
\r
175 public void setCreationDate(Date creationDate) {
\r
176 this.creationDate = creationDate;
\r