[SO] Release so 1.13.0 image
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / WorkflowActivitySpecSequence.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 - 2018 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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.so.db.catalog.beans;
22
23 import java.io.Serializable;
24 import javax.persistence.CascadeType;
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.FetchType;
28 import javax.persistence.GeneratedValue;
29 import javax.persistence.GenerationType;
30 import javax.persistence.Id;
31 import javax.persistence.JoinColumn;
32 import javax.persistence.ManyToOne;
33 import javax.persistence.Table;
34 import org.apache.commons.lang3.builder.EqualsBuilder;
35 import org.apache.commons.lang3.builder.HashCodeBuilder;
36 import org.apache.commons.lang3.builder.ToStringBuilder;
37 import com.openpojo.business.annotation.BusinessKey;
38 import uk.co.blackpepper.bowman.annotation.LinkedResource;
39 import uk.co.blackpepper.bowman.annotation.RemoteResource;
40
41
42 @Entity
43 @RemoteResource("/workflowActivitySpecSequence")
44 @Table(name = "workflow_activity_spec_sequence")
45 public class WorkflowActivitySpecSequence implements Serializable {
46
47     private static final long serialVersionUID = -8788505759463286871L;
48
49     @Id
50     @Column(name = "ID", nullable = false, updatable = false)
51     @GeneratedValue(strategy = GenerationType.IDENTITY)
52     private Integer ID;
53
54     @BusinessKey
55     @Column(name = "ACTIVITY_SPEC_ID")
56     private Integer activitySpecId;
57
58     @Column(name = "SEQ_NO")
59     private Integer seqNo;
60
61     @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
62     @JoinColumn(name = "ACTIVITY_SPEC_ID", updatable = false, insertable = false)
63     private ActivitySpec activitySpec;
64
65     @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
66     @JoinColumn(name = "WORKFLOW_ID")
67     private Workflow workflow;
68
69     @Override
70     public String toString() {
71         return new ToStringBuilder(this).append("activitySpecId", activitySpecId).toString();
72     }
73
74     @Override
75     public boolean equals(final Object other) {
76         if (!(other instanceof WorkflowActivitySpecSequence)) {
77             return false;
78         }
79         WorkflowActivitySpecSequence castOther = (WorkflowActivitySpecSequence) other;
80         return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId).isEquals();
81     }
82
83     @Override
84     public int hashCode() {
85         return new HashCodeBuilder().append(activitySpecId).toHashCode();
86     }
87
88     public Integer getID() {
89         return ID;
90     }
91
92     public Integer getActivitySpecId() {
93         return activitySpecId;
94     }
95
96     public void setActivitySpecId(Integer activitySpecId) {
97         this.activitySpecId = activitySpecId;
98     }
99
100     @LinkedResource
101     public ActivitySpec getActivitySpec() {
102         return activitySpec;
103     }
104
105     public void setActivitySpec(ActivitySpec activitySpec) {
106         this.activitySpec = activitySpec;
107     }
108
109     @LinkedResource
110     public Workflow getWorkflow() {
111         return workflow;
112     }
113
114     public void setWorkflow(Workflow workflow) {
115         this.workflow = workflow;
116     }
117
118     public Integer getSeqNo() {
119         return seqNo;
120     }
121
122     public void setSeqNo(Integer seqNo) {
123         this.seqNo = seqNo;
124     }
125
126 }