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;
26 import javax.persistence.CascadeType;
27 import javax.persistence.Column;
28 import javax.persistence.Entity;
29 import javax.persistence.FetchType;
30 import javax.persistence.Id;
31 import javax.persistence.JoinColumn;
32 import javax.persistence.ManyToOne;
33 import javax.persistence.PrePersist;
34 import javax.persistence.Table;
35 import javax.persistence.Temporal;
36 import javax.persistence.TemporalType;
38 import org.apache.commons.lang3.builder.EqualsBuilder;
39 import org.apache.commons.lang3.builder.HashCodeBuilder;
40 import org.apache.commons.lang3.builder.ToStringBuilder;
42 import com.openpojo.business.annotation.BusinessKey;
44 import uk.co.blackpepper.bowman.annotation.LinkedResource;
47 @Table(name = "collection_network_resource_customization")
48 public class CollectionNetworkResourceCustomization implements Serializable {
53 private static final long serialVersionUID = 11115611315801079L;
57 @Column(name = "MODEL_CUSTOMIZATION_UUID")
58 private String modelCustomizationUUID = null;
60 @Column(name = "MODEL_INSTANCE_NAME")
61 private String modelInstanceName;
63 @Column(name = "CREATION_TIMESTAMP", updatable = false)
64 @Temporal(TemporalType.TIMESTAMP)
68 @Column(name = "NETWORK_TECHNOLOGY")
69 private String networkTechnology;
72 @Column(name = "NETWORK_TYPE")
73 private String networkType = null;
76 @Column(name = "NETWORK_SCOPE")
77 private String networkScope;
80 @Column(name = "NETWORK_ROLE")
81 private String networkRole;
83 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
84 @JoinColumn(name = "NETWORK_RESOURCE_MODEL_UUID")
85 private NetworkResource networkResource = null;
87 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
88 @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID")
89 private InstanceGroup instanceGroup = null;
92 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
93 @JoinColumn(name = "CRC_MODEL_CUSTOMIZATION_UUID")
94 private NetworkCollectionResourceCustomization networkResourceCustomization = null;
97 protected void onCreate() {
98 this.created = new Date();
102 public boolean equals(final Object other) {
103 if (!(other instanceof CollectionNetworkResourceCustomization)) {
106 CollectionNetworkResourceCustomization castOther = (CollectionNetworkResourceCustomization) other;
107 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID)
108 .append(networkTechnology, castOther.networkTechnology).append(networkType, castOther.networkType)
109 .append(networkScope, castOther.networkScope).append(networkRole, castOther.networkRole)
110 .append(networkResourceCustomization, castOther.networkResourceCustomization).isEquals();
114 public int hashCode() {
115 return new HashCodeBuilder().append(modelCustomizationUUID).append(networkTechnology).append(networkType)
116 .append(networkScope).append(networkRole).append(networkResourceCustomization).toHashCode();
120 public String toString() {
121 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
122 .append("modelInstanceName", modelInstanceName).append("created", created)
123 .append("networkTechnology", networkTechnology).append("networkType", networkType)
124 .append("networkScope", networkScope).append("networkRole", networkRole)
125 .append("networkResource", networkResource).append("collectionResource", networkResourceCustomization)
129 public String getModelCustomizationUUID() {
130 return this.modelCustomizationUUID;
133 public void setModelCustomizationUUID(String modelCustomizationUUID) {
134 this.modelCustomizationUUID = modelCustomizationUUID;
138 public NetworkCollectionResourceCustomization getNetworkResourceCustomization() {
139 return networkResourceCustomization;
142 public void setNetworkResourceCustomization(NetworkCollectionResourceCustomization networkResourceCustomization) {
143 this.networkResourceCustomization = networkResourceCustomization;
146 public String getModelInstanceName() {
147 return this.modelInstanceName;
150 public void setModelInstanceName(String modelInstanceName) {
151 this.modelInstanceName = modelInstanceName;
155 public NetworkResource getNetworkResource() {
156 return this.networkResource;
159 public void setNetworkResource(NetworkResource networkResource) {
160 this.networkResource = networkResource;
163 public String getNetworkType() {
164 return this.networkType;
167 public void setNetworkType(String networkType) {
168 this.networkType = networkType;
171 public Date getCreated() {
175 public String getNetworkTechnology() {
176 return this.networkTechnology;
179 public void setNetworkTechnology(String networkTechnology) {
180 this.networkTechnology = networkTechnology;
183 public String getNetworkScope() {
184 return this.networkScope;
187 public void setNetworkScope(String networkScope) {
188 this.networkScope = networkScope;
191 public void setNetworkRole(String networkRole) {
192 this.networkRole = networkRole;
195 public String getNetworkRole() {
196 return this.networkRole;
200 public InstanceGroup getInstanceGroup() {
201 return instanceGroup;
204 public void setInstanceGroup(InstanceGroup instanceGroup) {
205 this.instanceGroup = instanceGroup;