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;
26 import javax.persistence.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.Id;
29 import javax.persistence.Lob;
30 import javax.persistence.PrePersist;
31 import javax.persistence.Table;
32 import javax.persistence.Temporal;
33 import javax.persistence.TemporalType;
35 import org.apache.commons.lang3.builder.EqualsBuilder;
36 import org.apache.commons.lang3.builder.HashCodeBuilder;
37 import org.apache.commons.lang3.builder.ToStringBuilder;
39 import com.openpojo.business.annotation.BusinessKey;
42 @Table(name = "heat_files")
43 public class HeatFiles implements Serializable {
45 private static final long serialVersionUID = 768026109321305392L;
49 @Column(name = "ARTIFACT_UUID")
50 private String artifactUuid;
52 @Column(name = "DESCRIPTION")
53 private String description = null;
55 @Column(name = "NAME")
56 private String fileName;
59 @Column(name = "BODY", columnDefinition = "LONGTEXT")
60 private String fileBody;
62 @Column(name = "CREATION_TIMESTAMP", updatable = false)
63 @Temporal(TemporalType.TIMESTAMP)
66 @Column(name = "ARTIFACT_CHECKSUM")
67 private String artifactChecksum;
69 @Column(name = "VERSION")
70 private String version;
73 protected void onCreate() {
74 this.created = new Date();
78 public String toString() {
79 return new ToStringBuilder(this).append("artifactUuid", artifactUuid).append("description", description)
80 .append("fileName", fileName).append("fileBody", fileBody).append("created", created)
81 .append("artifactChecksum", artifactChecksum).toString();
85 public boolean equals(final Object other) {
86 if (!(other instanceof HeatFiles)) {
89 HeatFiles castOther = (HeatFiles) other;
90 return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).isEquals();
94 public int hashCode() {
95 return new HashCodeBuilder().append(artifactUuid).toHashCode();
98 public String getArtifactUuid() {
99 return this.artifactUuid;
102 public void setArtifactUuid(String artifactUuid) {
103 this.artifactUuid = artifactUuid;
106 public String getDescription() {
107 return this.description;
110 public void setDescription(String description) {
111 this.description = description;
114 public String getFileName() {
115 return this.fileName;
118 public void setFileName(String fileName) {
119 this.fileName = fileName;
122 public String getFileBody() {
123 return this.fileBody;
126 public void setFileBody(String fileBody) {
127 this.fileBody = fileBody;
130 public Date getCreated() {
134 public String getAsdcUuid() {
135 return this.artifactUuid;
138 public void setAsdcUuid(String artifactUuid) {
139 this.artifactUuid = artifactUuid;
142 public String getArtifactChecksum() {
143 return artifactChecksum;
146 public void setArtifactChecksum(String artifactChecksum) {
147 this.artifactChecksum = artifactChecksum;
150 public String getVersion() {
154 public void setVersion(String version) {
155 this.version = version;