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;
43 @Table(name = "collection_network_resource_customization")
44 public class CollectionNetworkResourceCustomization implements Serializable {
49 private static final long serialVersionUID = 11115611315801079L;
53 @Column(name = "MODEL_CUSTOMIZATION_UUID")
54 private String modelCustomizationUUID = null;
56 @Column(name = "MODEL_INSTANCE_NAME")
57 private String modelInstanceName;
59 @Column(name = "CREATION_TIMESTAMP", updatable = false)
60 @Temporal(TemporalType.TIMESTAMP)
64 @Column(name = "NETWORK_TECHNOLOGY")
65 private String networkTechnology;
68 @Column(name = "NETWORK_TYPE")
69 private String networkType = null;
72 @Column(name = "NETWORK_SCOPE")
73 private String networkScope;
76 @Column(name = "NETWORK_ROLE")
77 private String networkRole;
79 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
80 @JoinColumn(name = "NETWORK_RESOURCE_MODEL_UUID")
81 private NetworkResource networkResource = null;
83 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
84 @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID")
85 private InstanceGroup instanceGroup = null;
88 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
89 @JoinColumn(name = "CRC_MODEL_CUSTOMIZATION_UUID")
90 private NetworkCollectionResourceCustomization networkResourceCustomization = null;
93 protected void onCreate() {
94 this.created = new Date();
98 public boolean equals(final Object other) {
99 if (!(other instanceof CollectionNetworkResourceCustomization)) {
102 CollectionNetworkResourceCustomization castOther = (CollectionNetworkResourceCustomization) other;
103 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID)
104 .append(networkTechnology, castOther.networkTechnology).append(networkType, castOther.networkType)
105 .append(networkScope, castOther.networkScope).append(networkRole, castOther.networkRole)
106 .append(networkResourceCustomization, castOther.networkResourceCustomization).isEquals();
110 public int hashCode() {
111 return new HashCodeBuilder().append(modelCustomizationUUID).append(networkTechnology).append(networkType)
112 .append(networkScope).append(networkRole).append(networkResourceCustomization).toHashCode();
116 public String toString() {
117 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
118 .append("modelInstanceName", modelInstanceName).append("created", created)
119 .append("networkTechnology", networkTechnology).append("networkType", networkType)
120 .append("networkScope", networkScope).append("networkRole", networkRole)
121 .append("networkResource", networkResource).append("collectionResource", networkResourceCustomization)
125 public String getModelCustomizationUUID() {
126 return this.modelCustomizationUUID;
129 public void setModelCustomizationUUID(String modelCustomizationUUID) {
130 this.modelCustomizationUUID = modelCustomizationUUID;
134 public NetworkCollectionResourceCustomization getNetworkResourceCustomization() {
135 return networkResourceCustomization;
138 public void setNetworkResourceCustomization(NetworkCollectionResourceCustomization networkResourceCustomization) {
139 this.networkResourceCustomization = networkResourceCustomization;
142 public String getModelInstanceName() {
143 return this.modelInstanceName;
146 public void setModelInstanceName(String modelInstanceName) {
147 this.modelInstanceName = modelInstanceName;
151 public NetworkResource getNetworkResource() {
152 return this.networkResource;
155 public void setNetworkResource(NetworkResource networkResource) {
156 this.networkResource = networkResource;
159 public String getNetworkType() {
160 return this.networkType;
163 public void setNetworkType(String networkType) {
164 this.networkType = networkType;
167 public Date getCreated() {
171 public String getNetworkTechnology() {
172 return this.networkTechnology;
175 public void setNetworkTechnology(String networkTechnology) {
176 this.networkTechnology = networkTechnology;
179 public String getNetworkScope() {
180 return this.networkScope;
183 public void setNetworkScope(String networkScope) {
184 this.networkScope = networkScope;
187 public void setNetworkRole(String networkRole) {
188 this.networkRole = networkRole;
191 public String getNetworkRole() {
192 return this.networkRole;
196 public InstanceGroup getInstanceGroup() {
197 return instanceGroup;
200 public void setInstanceGroup(InstanceGroup instanceGroup) {
201 this.instanceGroup = instanceGroup;