2 * ============LICENSE_START=======================================================
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
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 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;
42 @Table(name = "workflow_activity_spec_sequence")
43 public class WorkflowActivitySpecSequence implements Serializable {
45 private static final long serialVersionUID = -8788505759463286871L;
48 @Column(name = "ID", nullable = false, updatable = false)
49 @GeneratedValue(strategy = GenerationType.IDENTITY)
53 @Column(name = "ACTIVITY_SPEC_ID")
54 private Integer activitySpecId;
57 @Column(name = "WORKFLOW_ID")
58 private Integer workflowId;
60 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
61 @JoinColumn(name = "ACTIVITY_SPEC_ID", updatable = false, insertable = false)
62 private ActivitySpec activitySpec;
64 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
65 @JoinColumn(name = "WORKFLOW_ID", updatable = false, insertable = false)
66 private Workflow workflow;
69 public String toString() {
70 return new ToStringBuilder(this).append("workflowId", workflowId).append("activitySpecId", activitySpecId)
75 public boolean equals(final Object other) {
76 if (!(other instanceof WorkflowActivitySpecSequence)) {
79 WorkflowActivitySpecSequence castOther = (WorkflowActivitySpecSequence) other;
80 return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId)
81 .append(workflowId, castOther.workflowId).isEquals();
85 public int hashCode() {
86 return new HashCodeBuilder().append(activitySpecId).append(workflowId).toHashCode();
89 public Integer getID() {
93 public Integer getActivitySpecId() {
94 return activitySpecId;
97 public void setActivitySpecId(Integer activitySpecId) {
98 this.activitySpecId = activitySpecId;
101 public Integer getWorkflowId() {
105 public void setWorkflowId(Integer workflowId) {
106 this.workflowId = workflowId;
110 public ActivitySpec getActivitySpec() {
114 public void setActivitySpec(ActivitySpec activitySpec) {
115 this.activitySpec = activitySpec;
119 public Workflow getWorkflow() {
123 public void setWorkflow(Workflow workflow) {
124 this.workflow = workflow;