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
67 @Column(name = "content", nullable = false)
\r
68 @ApiModelProperty(required=true)
\r
69 private String content;
\r
72 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
\r
74 @Temporal(TemporalType.TIMESTAMP)
\r
75 @Column(name = "updated_date")
\r
76 private Date creationDate;
\r
79 public String toString() {
\r
80 return "[" + "id = " + id +
\r
81 ", name = " + name +
\r
82 ", contentType = " + contentType +
\r
87 public boolean equals(Object o) {
\r
92 if (!(o instanceof ConfigModelContent)) {
\r
95 ConfigModelContent configModelContent = (ConfigModelContent) o;
\r
96 return Objects.equals(id, configModelContent.id) && Objects.equals(name, configModelContent.name)
\r
97 && Objects.equals(contentType, configModelContent.contentType);
\r
101 public int hashCode() {
\r
102 return Objects.hash(id, name, contentType);
\r
105 public Long getId() {
\r
110 public void setId(Long id) {
\r
115 public String getName() {
\r
120 public void setName(String name) {
\r
125 public String getContentType() {
\r
126 return contentType;
\r
130 public void setContentType(String contentType) {
\r
131 this.contentType = contentType;
\r
135 public ConfigModel getConfigModel() {
\r
136 return configModel;
\r
140 public void setConfigModel(ConfigModel configModel) {
\r
141 this.configModel = configModel;
\r
145 public String getDescription() {
\r
146 return description;
\r
150 public void setDescription(String description) {
\r
151 this.description = description;
\r
155 public String getContent() {
\r
160 public void setContent(String content) {
\r
161 this.content = content;
\r
165 public Date getCreationDate() {
\r
166 return creationDate;
\r
170 public void setCreationDate(Date creationDate) {
\r
171 this.creationDate = creationDate;
\r