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;
23 import java.io.Serializable;
24 import java.util.Date;
25 import javax.persistence.CascadeType;
26 import javax.persistence.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.FetchType;
29 import javax.persistence.Id;
30 import javax.persistence.JoinColumn;
31 import javax.persistence.ManyToOne;
32 import javax.persistence.PrePersist;
33 import javax.persistence.Table;
34 import javax.persistence.Temporal;
35 import javax.persistence.TemporalType;
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 com.openpojo.business.annotation.BusinessKey;
40 import uk.co.blackpepper.bowman.annotation.LinkedResource;
41 import uk.co.blackpepper.bowman.annotation.RemoteResource;
44 @RemoteResource("/collectionNetworkResourceCustomization")
45 @Table(name = "collection_network_resource_customization")
46 public class CollectionNetworkResourceCustomization implements Serializable {
51 private static final long serialVersionUID = 11115611315801079L;
55 @Column(name = "MODEL_CUSTOMIZATION_UUID")
56 private String modelCustomizationUUID = null;
58 @Column(name = "MODEL_INSTANCE_NAME")
59 private String modelInstanceName;
61 @Column(name = "CREATION_TIMESTAMP", updatable = false)
62 @Temporal(TemporalType.TIMESTAMP)
66 @Column(name = "NETWORK_TECHNOLOGY")
67 private String networkTechnology;
70 @Column(name = "NETWORK_TYPE")
71 private String networkType = null;
74 @Column(name = "NETWORK_SCOPE")
75 private String networkScope;
78 @Column(name = "NETWORK_ROLE")
79 private String networkRole;
81 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
82 @JoinColumn(name = "NETWORK_RESOURCE_MODEL_UUID")
83 private NetworkResource networkResource = null;
85 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
86 @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID")
87 private InstanceGroup instanceGroup = null;
90 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
91 @JoinColumn(name = "CRC_MODEL_CUSTOMIZATION_UUID")
92 private NetworkCollectionResourceCustomization networkResourceCustomization = null;
95 protected void onCreate() {
96 this.created = new Date();
100 public boolean equals(final Object other) {
101 if (!(other instanceof CollectionNetworkResourceCustomization)) {
104 CollectionNetworkResourceCustomization castOther = (CollectionNetworkResourceCustomization) other;
105 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID)
106 .append(networkTechnology, castOther.networkTechnology).append(networkType, castOther.networkType)
107 .append(networkScope, castOther.networkScope).append(networkRole, castOther.networkRole)
108 .append(networkResourceCustomization, castOther.networkResourceCustomization).isEquals();
112 public int hashCode() {
113 return new HashCodeBuilder().append(modelCustomizationUUID).append(networkTechnology).append(networkType)
114 .append(networkScope).append(networkRole).append(networkResourceCustomization).toHashCode();
118 public String toString() {
119 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
120 .append("modelInstanceName", modelInstanceName).append("created", created)
121 .append("networkTechnology", networkTechnology).append("networkType", networkType)
122 .append("networkScope", networkScope).append("networkRole", networkRole)
123 .append("networkResource", networkResource).append("collectionResource", networkResourceCustomization)
127 public String getModelCustomizationUUID() {
128 return this.modelCustomizationUUID;
131 public void setModelCustomizationUUID(String modelCustomizationUUID) {
132 this.modelCustomizationUUID = modelCustomizationUUID;
136 public NetworkCollectionResourceCustomization getNetworkResourceCustomization() {
137 return networkResourceCustomization;
140 public void setNetworkResourceCustomization(NetworkCollectionResourceCustomization networkResourceCustomization) {
141 this.networkResourceCustomization = networkResourceCustomization;
144 public String getModelInstanceName() {
145 return this.modelInstanceName;
148 public void setModelInstanceName(String modelInstanceName) {
149 this.modelInstanceName = modelInstanceName;
153 public NetworkResource getNetworkResource() {
154 return this.networkResource;
157 public void setNetworkResource(NetworkResource networkResource) {
158 this.networkResource = networkResource;
161 public String getNetworkType() {
162 return this.networkType;
165 public void setNetworkType(String networkType) {
166 this.networkType = networkType;
169 public Date getCreated() {
173 public String getNetworkTechnology() {
174 return this.networkTechnology;
177 public void setNetworkTechnology(String networkTechnology) {
178 this.networkTechnology = networkTechnology;
181 public String getNetworkScope() {
182 return this.networkScope;
185 public void setNetworkScope(String networkScope) {
186 this.networkScope = networkScope;
189 public void setNetworkRole(String networkRole) {
190 this.networkRole = networkRole;
193 public String getNetworkRole() {
194 return this.networkRole;
198 public InstanceGroup getInstanceGroup() {
199 return instanceGroup;
202 public void setInstanceGroup(InstanceGroup instanceGroup) {
203 this.instanceGroup = instanceGroup;