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 java.util.List;
26 import javax.persistence.CascadeType;
27 import javax.persistence.Column;
28 import javax.persistence.Entity;
29 import javax.persistence.FetchType;
30 import javax.persistence.GeneratedValue;
31 import javax.persistence.GenerationType;
32 import javax.persistence.Id;
33 import javax.persistence.OneToMany;
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;
40 import com.openpojo.business.annotation.BusinessKey;
42 import uk.co.blackpepper.bowman.annotation.LinkedResource;
45 @Table(name = "northbound_request_ref_lookup")
46 public class NorthBoundRequest implements Serializable {
51 private static final long serialVersionUID = -2238991039015148725L;
55 @GeneratedValue(strategy = GenerationType.IDENTITY)
59 @Column(name = "MACRO_ACTION")
60 private String macroAction;
63 @Column(name = "ACTION")
64 private String action;
67 @Column(name = "REQUEST_SCOPE")
68 private String requestScope;
71 @Column(name = "IS_ALACARTE")
72 private Boolean isAlacarte;
75 @Column(name = "IS_TOPLEVELFLOW")
76 private Boolean isToplevelflow;
79 @Column(name = "MIN_API_VERSION")
80 private Double minApiVersion;
83 @Column(name = "MAX_API_VERSION")
84 private Double maxApiVersion;
86 @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "northBoundRequest")
87 private List<OrchestrationFlow> orchestrationFlowList;
90 public String toString() {
91 return new ToStringBuilder(this).append("id", id).append("action", action).append("requestScope", requestScope)
92 .append("isAlacarte", isAlacarte).append("isToplevelflow", isToplevelflow)
93 .append("minApiVersion", minApiVersion).append("maxApiVersion", maxApiVersion).toString();
97 public boolean equals(final Object other) {
98 if (!(other instanceof NorthBoundRequest)) {
101 NorthBoundRequest castOther = (NorthBoundRequest) other;
102 return new EqualsBuilder().append(action, castOther.action).append(requestScope, castOther.requestScope)
103 .append(isAlacarte, castOther.isAlacarte).append(isToplevelflow, castOther.isToplevelflow)
104 .append(minApiVersion, castOther.minApiVersion).append(maxApiVersion, castOther.maxApiVersion)
109 public int hashCode() {
110 return new HashCodeBuilder().append(action).append(requestScope).append(isAlacarte).append(isToplevelflow)
111 .append(minApiVersion).append(maxApiVersion).toHashCode();
114 public Integer getId() {
118 public void setId(Integer id) {
122 public String getAction() {
126 public void setAction(String action) {
127 this.action = action;
130 public String getMacroAction() {
134 public void setMacroAction(String macroAction) {
135 this.macroAction = macroAction;
138 public String getRequestScope() {
142 public void setRequestScope(String requestScope) {
143 this.requestScope = requestScope;
146 public Boolean getIsAlacarte() {
150 public void setIsAlacarte(Boolean isAlacarte) {
151 this.isAlacarte = isAlacarte;
154 public Boolean getIsToplevelflow() {
155 return isToplevelflow;
158 public void setIsToplevelflow(Boolean isToplevelflow) {
159 this.isToplevelflow = isToplevelflow;
162 public Double getMinApiVersion() {
163 return minApiVersion;
166 public void setMinApiVersion(Double minApiVersion) {
167 this.minApiVersion = minApiVersion;
170 public Double getMaxApiVersion() {
171 return maxApiVersion;
174 public void setMaxApiVersion(Double maxApiVersion) {
175 this.maxApiVersion = maxApiVersion;
179 public List<OrchestrationFlow> getOrchestrationFlowList() {
180 return orchestrationFlowList;
183 public void setOrchestrationFlowList(List<OrchestrationFlow> orchestrationFlowList) {
184 this.orchestrationFlowList = orchestrationFlowList;