2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.so.db.catalog.beans;
23 import java.io.Serializable;
24 import java.util.Date;
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.Id;
28 import javax.persistence.Lob;
29 import javax.persistence.PrePersist;
30 import javax.persistence.Table;
31 import javax.persistence.Temporal;
32 import javax.persistence.TemporalType;
33 import org.apache.commons.lang3.builder.EqualsBuilder;
34 import org.apache.commons.lang3.builder.HashCodeBuilder;
35 import org.apache.commons.lang3.builder.ToStringBuilder;
36 import com.openpojo.business.annotation.BusinessKey;
39 @Table(name = "heat_files")
40 public class HeatFiles implements Serializable {
42 private static final long serialVersionUID = 768026109321305392L;
46 @Column(name = "ARTIFACT_UUID")
47 private String artifactUuid;
49 @Column(name = "DESCRIPTION")
50 private String description = null;
52 @Column(name = "NAME")
53 private String fileName;
56 @Column(name = "BODY", columnDefinition = "LONGTEXT")
57 private String fileBody;
59 @Column(name = "CREATION_TIMESTAMP", updatable = false)
60 @Temporal(TemporalType.TIMESTAMP)
63 @Column(name = "ARTIFACT_CHECKSUM")
64 private String artifactChecksum;
66 @Column(name = "VERSION")
67 private String version;
70 protected void onCreate() {
71 this.created = new Date();
75 public String toString() {
76 return new ToStringBuilder(this).append("artifactUuid", artifactUuid).append("description", description)
77 .append("fileName", fileName).append("fileBody", fileBody).append("created", created)
78 .append("artifactChecksum", artifactChecksum).toString();
82 public boolean equals(final Object other) {
83 if (!(other instanceof HeatFiles)) {
86 HeatFiles castOther = (HeatFiles) other;
87 return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).isEquals();
91 public int hashCode() {
92 return new HashCodeBuilder().append(artifactUuid).toHashCode();
95 public String getArtifactUuid() {
96 return this.artifactUuid;
99 public void setArtifactUuid(String artifactUuid) {
100 this.artifactUuid = artifactUuid;
103 public String getDescription() {
104 return this.description;
107 public void setDescription(String description) {
108 this.description = description;
111 public String getFileName() {
112 return this.fileName;
115 public void setFileName(String fileName) {
116 this.fileName = fileName;
119 public String getFileBody() {
120 return this.fileBody;
123 public void setFileBody(String fileBody) {
124 this.fileBody = fileBody;
127 public Date getCreated() {
131 public String getAsdcUuid() {
132 return this.artifactUuid;
135 public void setAsdcUuid(String artifactUuid) {
136 this.artifactUuid = artifactUuid;
139 public String getArtifactChecksum() {
140 return artifactChecksum;
143 public void setArtifactChecksum(String artifactChecksum) {
144 this.artifactChecksum = artifactChecksum;
147 public String getVersion() {
151 public void setVersion(String version) {
152 this.version = version;