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("/networkResourceCustomization")
45 @Table(name = "network_resource_customization")
46 public class NetworkResourceCustomization implements Serializable {
47 public static final long serialVersionUID = -1322322139926390329L;
51 @Column(name = "MODEL_CUSTOMIZATION_UUID")
52 private String modelCustomizationUUID = null;
54 @Column(name = "MODEL_INSTANCE_NAME")
55 private String modelInstanceName;
57 @Column(name = "CREATION_TIMESTAMP", updatable = false)
58 @Temporal(TemporalType.TIMESTAMP)
61 @Column(name = "NETWORK_TECHNOLOGY")
62 private String networkTechnology;
64 @Column(name = "NETWORK_TYPE")
65 private String networkType = null;
67 @Column(name = "NETWORK_SCOPE")
68 private String networkScope;
70 @Column(name = "NETWORK_ROLE")
71 private String networkRole;
73 @Column(name = "RESOURCE_INPUT")
74 private String resourceInput;
76 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
77 @JoinColumn(name = "NETWORK_RESOURCE_MODEL_UUID")
78 private NetworkResource networkResource = null;
80 public NetworkResourceCustomization() {
85 protected void onCreate() {
86 this.created = new Date();
89 public String getModelCustomizationUUID() {
90 return this.modelCustomizationUUID;
93 public void setModelCustomizationUUID(String modelCustomizationUUID) {
94 this.modelCustomizationUUID = modelCustomizationUUID;
97 public String getModelInstanceName() {
98 return this.modelInstanceName;
101 public void setModelInstanceName(String modelInstanceName) {
102 this.modelInstanceName = modelInstanceName;
106 public NetworkResource getNetworkResource() {
107 return this.networkResource;
110 public void setNetworkResource(NetworkResource networkResource) {
111 this.networkResource = networkResource;
114 public String getNetworkType() {
115 return this.networkType;
118 public void setNetworkType(String networkType) {
119 this.networkType = networkType;
122 public Date getCreated() {
126 public String getNetworkTechnology() {
127 return this.networkTechnology;
130 public void setNetworkTechnology(String networkTechnology) {
131 this.networkTechnology = networkTechnology;
134 public String getNetworkScope() {
135 return this.networkScope;
138 public void setNetworkScope(String networkScope) {
139 this.networkScope = networkScope;
142 public void setNetworkRole(String networkRole) {
143 this.networkRole = networkRole;
146 public String getNetworkRole() {
147 return this.networkRole;
150 public String getResourceInput() {
151 return resourceInput;
154 public void setResourceInput(String resourceInput) {
155 this.resourceInput = resourceInput;
159 public String toString() {
160 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
161 .append("modelInstanceName", modelInstanceName).append("created", created)
162 .append("networkTechnology", networkTechnology).append("networkType", networkType)
163 .append("networkScope", networkScope).append("networkRole", networkRole)
164 .append("networkResource", networkResource).toString();
168 public boolean equals(final Object other) {
169 if (!(other instanceof NetworkResourceCustomization)) {
172 NetworkResourceCustomization castOther = (NetworkResourceCustomization) other;
173 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
177 public int hashCode() {
178 return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();