2 * Copyright © 2017-2018 AT&T Intellectual Property.
3 * Modifications Copyright © 2019 Bell Canada.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 package org.onap.ccsdk.cds.controllerblueprints.service.domain;
20 import com.fasterxml.jackson.annotation.JsonFormat;
21 import io.swagger.annotations.ApiModelProperty;
22 import org.springframework.data.annotation.LastModifiedDate;
23 import org.springframework.data.jpa.domain.support.AuditingEntityListener;
25 import javax.persistence.*;
26 import java.io.Serializable;
27 import java.util.Date;
28 import java.util.Objects;
31 * DataDictionary.java Purpose: Provide Configuration Generator DataDictionary Entity
33 * @author Brinda Santh
36 @EntityListeners({AuditingEntityListener.class})
38 @Table(name = "CONFIG_MODEL_CONTENT")
39 public class BlueprintModelContent implements Serializable {
41 private static final long serialVersionUID = 1L;
44 @Column(name = "config_model_content_id")
47 @Column(name = "name", nullable = false)
48 @ApiModelProperty(required=true)
51 @Column(name = "content_type", nullable = false)
52 @ApiModelProperty(required=true)
53 private String contentType;
56 @JoinColumn(name = "config_model_id")
57 private BlueprintModel blueprintModel;
60 @Column(name = "description")
61 private String description;
64 @Column(name = "content", nullable = false)
65 @ApiModelProperty(required=true)
66 private byte[] content;
68 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
70 @Temporal(TemporalType.TIMESTAMP)
71 @Column(name = "updated_date")
72 private Date creationDate = new Date();
75 public String toString() {
76 return "[" + "id = " + id +
78 ", contentType = " + contentType +
83 public boolean equals(Object o) {
88 if (!(o instanceof BlueprintModelContent)) {
91 BlueprintModelContent blueprintModelContent = (BlueprintModelContent) o;
92 return Objects.equals(id, blueprintModelContent.id) && Objects.equals(name, blueprintModelContent.name)
93 && Objects.equals(contentType, blueprintModelContent.contentType);
97 public int hashCode() {
98 return Objects.hash(id, name, contentType);
101 public String getId() {
106 public void setId(String id) {
111 public String getName() {
116 public void setName(String name) {
121 public String getContentType() {
126 public void setContentType(String contentType) {
127 this.contentType = contentType;
131 public BlueprintModel getBlueprintModel() {
132 return blueprintModel;
136 public void setBlueprintModel(BlueprintModel blueprintModel) {
137 this.blueprintModel = blueprintModel;
141 public String getDescription() {
146 public void setDescription(String description) {
147 this.description = description;
151 public byte[] getContent() {
156 public void setContent(byte[] content) {
157 this.content = content;
161 public Date getCreationDate() {
166 public void setCreationDate(Date creationDate) {
167 this.creationDate = creationDate;