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.macro;
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 org.onap.so.db.catalog.beans.BuildingBlockDetail;
38 import com.openpojo.business.annotation.BusinessKey;
39 import uk.co.blackpepper.bowman.annotation.LinkedResource;
42 @Table(name = "orchestration_flow_reference")
43 public class OrchestrationFlow implements Serializable {
45 private static final long serialVersionUID = 2457818854397870011L;
49 @GeneratedValue(strategy = GenerationType.IDENTITY)
53 @Column(name = "COMPOSITE_ACTION")
54 private String action;
57 @Column(name = "SEQ_NO")
58 private Integer sequenceNumber;
61 @Column(name = "FLOW_NAME")
62 private String flowName;
65 @Column(name = "FLOW_VERSION")
66 private Double flowVersion;
68 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
69 @JoinColumn(name = "NB_REQ_REF_LOOKUP_ID")
70 private NorthBoundRequest northBoundRequest;
73 public String toString() {
74 return new ToStringBuilder(this).append("id", id).append("action", action)
75 .append("sequenceNumber", sequenceNumber).append("flowName", flowName)
76 .append("flowVersion", flowVersion).toString();
80 public boolean equals(final Object other) {
81 if (!(other instanceof OrchestrationFlow)) {
84 OrchestrationFlow castOther = (OrchestrationFlow) other;
85 return new EqualsBuilder().append(action, castOther.action).append(sequenceNumber, castOther.sequenceNumber)
86 .append(flowName, castOther.flowName).append(flowVersion, castOther.flowVersion).isEquals();
90 public int hashCode() {
91 return new HashCodeBuilder().append(action).append(sequenceNumber).append(flowName).append(flowVersion)
95 public String getAction() {
99 public void setAction(String action) {
100 this.action = action;
103 public Integer getSequenceNumber() {
104 return sequenceNumber;
107 public void setSequenceNumber(Integer sequenceNumber) {
108 this.sequenceNumber = sequenceNumber;
111 public String getFlowName() {
115 public void setFlowName(String flowName) {
116 this.flowName = flowName;
119 public Double getFlowVersion() {
123 public void setFlowVersion(Double flowVersion) {
124 this.flowVersion = flowVersion;
127 public Integer getId() {
131 public void setId(Integer id) {
136 public NorthBoundRequest getNorthBoundRequest() {
137 return northBoundRequest;
140 public void setNorthBoundRequest(NorthBoundRequest northBoundRequest) {
141 this.northBoundRequest = northBoundRequest;