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;
25 import javax.persistence.CascadeType;
26 import javax.persistence.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.FetchType;
29 import javax.persistence.GeneratedValue;
30 import javax.persistence.GenerationType;
31 import javax.persistence.Id;
32 import javax.persistence.JoinColumn;
33 import javax.persistence.ManyToOne;
34 import javax.persistence.Table;
36 import org.apache.commons.lang3.builder.EqualsBuilder;
37 import org.apache.commons.lang3.builder.HashCodeBuilder;
38 import org.apache.commons.lang3.builder.ToStringBuilder;
39 import org.onap.so.db.catalog.beans.BuildingBlockDetail;
41 import com.openpojo.business.annotation.BusinessKey;
43 import uk.co.blackpepper.bowman.annotation.LinkedResource;
46 @Table(name = "orchestration_flow_reference")
47 public class OrchestrationFlow implements Serializable {
49 private static final long serialVersionUID = 2457818854397870011L;
53 @GeneratedValue(strategy = GenerationType.IDENTITY)
57 @Column(name = "COMPOSITE_ACTION")
58 private String action;
61 @Column(name = "SEQ_NO")
62 private Integer sequenceNumber;
65 @Column(name = "FLOW_NAME")
66 private String flowName;
69 @Column(name = "FLOW_VERSION")
70 private Double flowVersion;
72 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
73 @JoinColumn(name = "NB_REQ_REF_LOOKUP_ID")
74 private NorthBoundRequest northBoundRequest;
77 public String toString() {
78 return new ToStringBuilder(this).append("id", id).append("action", action)
79 .append("sequenceNumber", sequenceNumber).append("flowName", flowName)
80 .append("flowVersion", flowVersion).toString();
84 public boolean equals(final Object other) {
85 if (!(other instanceof OrchestrationFlow)) {
88 OrchestrationFlow castOther = (OrchestrationFlow) other;
89 return new EqualsBuilder().append(action, castOther.action).append(sequenceNumber, castOther.sequenceNumber)
90 .append(flowName, castOther.flowName).append(flowVersion, castOther.flowVersion).isEquals();
94 public int hashCode() {
95 return new HashCodeBuilder().append(action).append(sequenceNumber).append(flowName).append(flowVersion)
99 public String getAction() {
103 public void setAction(String action) {
104 this.action = action;
107 public Integer getSequenceNumber() {
108 return sequenceNumber;
111 public void setSequenceNumber(Integer sequenceNumber) {
112 this.sequenceNumber = sequenceNumber;
115 public String getFlowName() {
119 public void setFlowName(String flowName) {
120 this.flowName = flowName;
123 public Double getFlowVersion() {
127 public void setFlowVersion(Double flowVersion) {
128 this.flowVersion = flowVersion;
131 public Integer getId() {
135 public void setId(Integer id) {
140 public NorthBoundRequest getNorthBoundRequest() {
141 return northBoundRequest;
144 public void setNorthBoundRequest(NorthBoundRequest northBoundRequest) {
145 this.northBoundRequest = northBoundRequest;