2 * Copyright © 2017-2018 AT&T Intellectual Property.
\r
3 * Modifications Copyright © 2019 Bell Canada.
\r
5 * Licensed under the Apache License, Version 2.0 (the "License");
\r
6 * you may not use this file except in compliance with the License.
\r
7 * You may obtain a copy of the License at
\r
9 * http://www.apache.org/licenses/LICENSE-2.0
\r
11 * Unless required by applicable law or agreed to in writing, software
\r
12 * distributed under the License is distributed on an "AS IS" BASIS,
\r
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
14 * See the License for the specific language governing permissions and
\r
15 * limitations under the License.
\r
18 package org.onap.ccsdk.apps.controllerblueprints.service.domain;
\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.io.Serializable;
\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 BlueprintModelContent implements Serializable {
\r
41 private static final long serialVersionUID = 1L;
\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
56 @JoinColumn(name = "config_model_id")
\r
57 private BlueprintModel blueprintModel;
\r
60 @Column(name = "description")
\r
61 private String description;
\r
64 @Column(name = "content", nullable = false)
\r
65 @ApiModelProperty(required=true)
\r
66 private byte[] content;
\r
68 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
\r
70 @Temporal(TemporalType.TIMESTAMP)
\r
71 @Column(name = "updated_date")
\r
72 private Date creationDate = new Date();
\r
75 public String toString() {
\r
76 return "[" + "id = " + id +
\r
77 ", name = " + name +
\r
78 ", contentType = " + contentType +
\r
83 public boolean equals(Object o) {
\r
88 if (!(o instanceof BlueprintModelContent)) {
\r
91 BlueprintModelContent blueprintModelContent = (BlueprintModelContent) o;
\r
92 return Objects.equals(id, blueprintModelContent.id) && Objects.equals(name, blueprintModelContent.name)
\r
93 && Objects.equals(contentType, blueprintModelContent.contentType);
\r
97 public int hashCode() {
\r
98 return Objects.hash(id, name, contentType);
\r
101 public String getId() {
\r
106 public void setId(String id) {
\r
111 public String getName() {
\r
116 public void setName(String name) {
\r
121 public String getContentType() {
\r
122 return contentType;
\r
126 public void setContentType(String contentType) {
\r
127 this.contentType = contentType;
\r
131 public BlueprintModel getBlueprintModel() {
\r
132 return blueprintModel;
\r
136 public void setBlueprintModel(BlueprintModel blueprintModel) {
\r
137 this.blueprintModel = blueprintModel;
\r
141 public String getDescription() {
\r
142 return description;
\r
146 public void setDescription(String description) {
\r
147 this.description = description;
\r
151 public byte[] getContent() {
\r
156 public void setContent(byte[] content) {
\r
157 this.content = content;
\r
161 public Date getCreationDate() {
\r
162 return creationDate;
\r
166 public void setCreationDate(Date creationDate) {
\r
167 this.creationDate = creationDate;
\r