Replaced all tabs with spaces in java and pom.xml
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / Workflow.java
1 package org.onap.so.db.catalog.beans;
2
3 import java.io.Serializable;
4 import java.util.ArrayList;
5 import java.util.Date;
6 import java.util.List;
7 import javax.persistence.Column;
8 import javax.persistence.Entity;
9 import javax.persistence.FetchType;
10 import javax.persistence.GeneratedValue;
11 import javax.persistence.GenerationType;
12 import javax.persistence.Id;
13 import javax.persistence.JoinColumn;
14 import javax.persistence.Lob;
15 import javax.persistence.ManyToOne;
16 import javax.persistence.OneToMany;
17 import javax.persistence.PrePersist;
18 import javax.persistence.Table;
19 import javax.persistence.Temporal;
20 import javax.persistence.TemporalType;
21 import org.apache.commons.lang3.builder.EqualsBuilder;
22 import org.apache.commons.lang3.builder.HashCodeBuilder;
23 import org.apache.commons.lang3.builder.ToStringBuilder;
24 import com.openpojo.business.annotation.BusinessKey;
25 import org.hibernate.annotations.NotFound;
26 import org.hibernate.annotations.NotFoundAction;
27 import uk.co.blackpepper.bowman.annotation.LinkedResource;
28
29 @Entity
30 @Table(name = "workflow")
31 public class Workflow implements Serializable {
32
33     private static final long serialVersionUID = 1485794141983033264L;
34
35     @Id
36     @Column(name = "ID", nullable = false, updatable = false)
37     @GeneratedValue(strategy = GenerationType.IDENTITY)
38     private Integer ID;
39
40     @Column(name = "ARTIFACT_UUID")
41     private String artifactUUID;
42
43     @Column(name = "ARTIFACT_NAME")
44     private String artifactName;
45
46     @Column(name = "NAME")
47     private String name;
48
49     @Column(name = "OPERATION_NAME")
50     private String operationName;
51
52     @Column(name = "VERSION")
53     private Double version;
54
55     @Column(name = "DESCRIPTION")
56     private String description;
57
58     @Lob
59     @Column(name = "BODY", columnDefinition = "LONGTEXT")
60     private String body = null;
61
62     @Column(name = "RESOURCE_TARGET")
63     private String resourceTarget;
64
65     @Column(name = "SOURCE")
66     private String source;
67
68     @Column(name = "TIMEOUT_MINUTES")
69     private Integer timeoutMinutes;
70
71     @Column(name = "ARTIFACT_CHECKSUM")
72     private String artifactChecksum;
73
74     @Column(name = "CREATION_TIMESTAMP", updatable = false)
75     @Temporal(TemporalType.TIMESTAMP)
76     private Date created;
77
78     @OneToMany(fetch = FetchType.LAZY, mappedBy = "workflow")
79     private List<VnfResourceWorkflow> vnfResourceWorkflow;
80
81     @OneToMany(fetch = FetchType.LAZY, mappedBy = "workflow")
82     private List<WorkflowActivitySpecSequence> workflowActivitySpecSequence;
83
84     @PrePersist
85     protected void onCreate() {
86         this.created = new Date();
87     }
88
89     public Integer getID() {
90         return ID;
91     }
92
93     public String getArtifactUUID() {
94         return artifactUUID;
95     }
96
97     public void setArtifactUUID(String artifactUUID) {
98         this.artifactUUID = artifactUUID;
99     }
100
101     public String getArtifactName() {
102         return artifactName;
103     }
104
105     public void setArtifactName(String artifactName) {
106         this.artifactName = artifactName;
107     }
108
109     public String getName() {
110         return name;
111     }
112
113     public void setName(String name) {
114         this.name = name;
115     }
116
117     public String getOperationName() {
118         return operationName;
119     }
120
121     public void setOperationName(String operationName) {
122         this.operationName = operationName;
123     }
124
125     public Double getVersion() {
126         return version;
127     }
128
129     public void setVersion(Double version) {
130         this.version = version;
131     }
132
133     public String getDescription() {
134         return description;
135     }
136
137     public void setDescription(String description) {
138         this.description = description;
139     }
140
141     public String getBody() {
142         return body;
143     }
144
145     public void setBody(String body) {
146         this.body = body;
147     }
148
149     public String getResourceTarget() {
150         return resourceTarget;
151     }
152
153     public void setResourceTarget(String resourceTarget) {
154         this.resourceTarget = resourceTarget;
155     }
156
157     public String getSource() {
158         return source;
159     }
160
161     public void setSource(String source) {
162         this.source = source;
163     }
164
165     public Integer getTimeoutMinutes() {
166         return timeoutMinutes;
167     }
168
169     public void setTimeoutMinutes(Integer timeoutMinutes) {
170         this.timeoutMinutes = timeoutMinutes;
171     }
172
173     public String getArtifactChecksum() {
174         return artifactChecksum;
175     }
176
177     public void setArtifactChecksum(String artifactChecksum) {
178         this.artifactChecksum = artifactChecksum;
179     }
180
181     public Date getCreated() {
182         return created;
183     }
184
185     public void setCreated(Date created) {
186         this.created = created;
187     }
188
189     @LinkedResource
190     public List<VnfResourceWorkflow> getVnfResourceWorkflow() {
191         return vnfResourceWorkflow;
192     }
193
194     public void setVnfResourceWorkflow(List<VnfResourceWorkflow> vnfResourceWorkflow) {
195         this.vnfResourceWorkflow = vnfResourceWorkflow;
196     }
197
198     @LinkedResource
199     public List<WorkflowActivitySpecSequence> getWorkflowActivitySpecSequence() {
200         return workflowActivitySpecSequence;
201     }
202
203     public void setWorkflowActivitySpecSequence(List<WorkflowActivitySpecSequence> workflowActivitySpecSequence) {
204         this.workflowActivitySpecSequence = workflowActivitySpecSequence;
205     }
206
207     @Override
208     public String toString() {
209         return new ToStringBuilder(this).append("ID", ID).append("artifactUUID", artifactUUID)
210                 .append("artifactName", artifactName).append("name", name).append("operationName", operationName)
211                 .append("version", version).append("description", description).append("body", body)
212                 .append("resourceTarget", resourceTarget).append("source", source)
213                 .append("timeoutMinutes", timeoutMinutes).append("artifactChecksum", artifactChecksum)
214                 .append("created", created).append("vnfResourceWorkflow", vnfResourceWorkflow)
215                 .append("WorkflowActivitySpecSequence", workflowActivitySpecSequence).toString();
216     }
217
218     @Override
219     public boolean equals(final Object other) {
220         if (!(other instanceof Workflow)) {
221             return false;
222         }
223         Workflow castOther = (Workflow) other;
224         return new EqualsBuilder().append(ID, castOther.ID).isEquals();
225     }
226
227     @Override
228     public int hashCode() {
229         return new HashCodeBuilder().append(ID).toHashCode();
230     }
231 }