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;
41 @Table(name = "activity_spec_to_user_parameters")
42 public class ActivitySpecUserParameters implements Serializable {
44 private static final long serialVersionUID = 5599242118780268449L;
47 @Column(name = "ID", nullable = false, updatable = false)
48 @GeneratedValue(strategy = GenerationType.IDENTITY)
52 @Column(name = "ACTIVITY_SPEC_ID")
53 private Integer activitySpecId;
56 @Column(name = "USER_PARAMETERS_ID")
57 private Integer userParametersId;
59 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
60 @JoinColumn(name = "ACTIVITY_SPEC_ID", updatable = false, insertable = false)
61 private ActivitySpec activitySpec;
63 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
64 @JoinColumn(name = "USER_PARAMETERS_ID", updatable = false, insertable = false)
65 private UserParameters userParameters;
68 public String toString() {
69 return new ToStringBuilder(this).append("activitySpecId", activitySpecId)
70 .append("userParametersId", userParametersId).toString();
74 public boolean equals(final Object other) {
75 if (!(other instanceof ActivitySpecUserParameters)) {
78 ActivitySpecUserParameters castOther = (ActivitySpecUserParameters) other;
79 return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId)
80 .append(userParametersId, castOther.userParametersId).isEquals();
84 public int hashCode() {
85 return new HashCodeBuilder().append(activitySpecId).append(userParametersId).toHashCode();
88 public Integer getID() {
92 public Integer getActivitySpecId() {
93 return activitySpecId;
96 public void setActivitySpecId(Integer activitySpecId) {
97 this.activitySpecId = activitySpecId;
100 public Integer getUserParametersId() {
101 return userParametersId;
104 public void setUserParametersId(Integer userParametersId) {
105 this.userParametersId = userParametersId;
109 public ActivitySpec getActivitySpec() {
113 public void setActivitySpec(ActivitySpec activitySpec) {
114 this.activitySpec = activitySpec;
118 public UserParameters getUserParameters() {
119 return userParameters;
122 public void setUserParameters(UserParameters userParameters) {
123 this.userParameters = userParameters;