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 = "network_resource_customization")
48 public class NetworkResourceCustomization implements Serializable {
49 public static final long serialVersionUID = -1322322139926390329L;
52 public String toString() {
53 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
54 .append("modelInstanceName", modelInstanceName).append("created", created)
55 .append("networkTechnology", networkTechnology).append("networkType", networkType)
56 .append("networkScope", networkScope).append("networkRole", networkRole)
57 .append("networkResource", networkResource).toString();
61 public boolean equals(final Object other) {
62 if (!(other instanceof NetworkResourceCustomization)) {
65 NetworkResourceCustomization castOther = (NetworkResourceCustomization) other;
66 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
70 public int hashCode() {
71 return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
74 public NetworkResourceCustomization() {
80 @Column(name = "MODEL_CUSTOMIZATION_UUID")
81 private String modelCustomizationUUID = null;
83 @Column(name = "MODEL_INSTANCE_NAME")
84 private String modelInstanceName;
86 @Column(name = "CREATION_TIMESTAMP", updatable = false)
87 @Temporal(TemporalType.TIMESTAMP)
90 @Column(name = "NETWORK_TECHNOLOGY")
91 private String networkTechnology;
93 @Column(name = "NETWORK_TYPE")
94 private String networkType = null;
96 @Column(name = "NETWORK_SCOPE")
97 private String networkScope;
99 @Column(name = "NETWORK_ROLE")
100 private String networkRole;
102 @Column(name = "RESOURCE_INPUT")
103 private String resourceInput;
105 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
106 @JoinColumn(name = "NETWORK_RESOURCE_MODEL_UUID")
107 private NetworkResource networkResource = null;
110 protected void onCreate() {
111 this.created = new Date();
114 public String getModelCustomizationUUID() {
115 return this.modelCustomizationUUID;
118 public void setModelCustomizationUUID(String modelCustomizationUUID) {
119 this.modelCustomizationUUID = modelCustomizationUUID;
122 public String getModelInstanceName() {
123 return this.modelInstanceName;
126 public void setModelInstanceName(String modelInstanceName) {
127 this.modelInstanceName = modelInstanceName;
131 public NetworkResource getNetworkResource() {
132 return this.networkResource;
135 public void setNetworkResource(NetworkResource networkResource) {
136 this.networkResource = networkResource;
139 public String getNetworkType() {
140 return this.networkType;
143 public void setNetworkType(String networkType) {
144 this.networkType = networkType;
147 public Date getCreated() {
151 public String getNetworkTechnology() {
152 return this.networkTechnology;
155 public void setNetworkTechnology(String networkTechnology) {
156 this.networkTechnology = networkTechnology;
159 public String getNetworkScope() {
160 return this.networkScope;
163 public void setNetworkScope(String networkScope) {
164 this.networkScope = networkScope;
167 public void setNetworkRole(String networkRole) {
168 this.networkRole = networkRole;
171 public String getNetworkRole() {
172 return this.networkRole;
175 public String getResourceInput() {
176 return resourceInput;
179 public void setResourceInput(String resourceInput) {
180 this.resourceInput = resourceInput;