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;
37 import uk.co.blackpepper.bowman.annotation.RemoteResource;
40 @RemoteResource("/heatFiles")
41 @Table(name = "heat_files")
42 public class HeatFiles implements Serializable {
44 private static final long serialVersionUID = 768026109321305392L;
48 @Column(name = "ARTIFACT_UUID")
49 private String artifactUuid;
51 @Column(name = "DESCRIPTION")
52 private String description = null;
54 @Column(name = "NAME")
55 private String fileName;
58 @Column(name = "BODY", columnDefinition = "LONGTEXT")
59 private String fileBody;
61 @Column(name = "CREATION_TIMESTAMP", updatable = false)
62 @Temporal(TemporalType.TIMESTAMP)
65 @Column(name = "ARTIFACT_CHECKSUM")
66 private String artifactChecksum;
68 @Column(name = "VERSION")
69 private String version;
72 protected void onCreate() {
73 this.created = new Date();
77 public String toString() {
78 return new ToStringBuilder(this).append("artifactUuid", artifactUuid).append("description", description)
79 .append("fileName", fileName).append("fileBody", fileBody).append("created", created)
80 .append("artifactChecksum", artifactChecksum).toString();
84 public boolean equals(final Object other) {
85 if (!(other instanceof HeatFiles)) {
88 HeatFiles castOther = (HeatFiles) other;
89 return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).isEquals();
93 public int hashCode() {
94 return new HashCodeBuilder().append(artifactUuid).toHashCode();
97 public String getArtifactUuid() {
98 return this.artifactUuid;
101 public void setArtifactUuid(String artifactUuid) {
102 this.artifactUuid = artifactUuid;
105 public String getDescription() {
106 return this.description;
109 public void setDescription(String description) {
110 this.description = description;
113 public String getFileName() {
114 return this.fileName;
117 public void setFileName(String fileName) {
118 this.fileName = fileName;
121 public String getFileBody() {
122 return this.fileBody;
125 public void setFileBody(String fileBody) {
126 this.fileBody = fileBody;
129 public Date getCreated() {
133 public String getAsdcUuid() {
134 return this.artifactUuid;
137 public void setAsdcUuid(String artifactUuid) {
138 this.artifactUuid = artifactUuid;
141 public String getArtifactChecksum() {
142 return artifactChecksum;
145 public void setArtifactChecksum(String artifactChecksum) {
146 this.artifactChecksum = artifactChecksum;
149 public String getVersion() {
153 public void setVersion(String version) {
154 this.version = version;