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