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.GeneratedValue;
31 import javax.persistence.GenerationType;
32 import javax.persistence.Id;
33 import javax.persistence.JoinColumn;
34 import javax.persistence.ManyToOne;
35 import javax.persistence.PrePersist;
36 import javax.persistence.Table;
37 import javax.persistence.Temporal;
38 import javax.persistence.TemporalType;
40 import org.apache.commons.lang3.builder.EqualsBuilder;
41 import org.apache.commons.lang3.builder.HashCodeBuilder;
42 import org.apache.commons.lang3.builder.ToStringBuilder;
44 import com.fasterxml.jackson.annotation.JsonFormat;
45 import com.openpojo.business.annotation.BusinessKey;
47 import uk.co.blackpepper.bowman.annotation.LinkedResource;
50 @Table(name = "vnf_vfmodule_cvnfc_configuration_customization")
51 public class VnfVfmoduleCvnfcConfigurationCustomization implements Serializable {
53 private static final long serialVersionUID = -3153216266280581103L;
57 @GeneratedValue(strategy = GenerationType.IDENTITY)
61 @Column(name = "MODEL_CUSTOMIZATION_UUID")
62 private String modelCustomizationUUID;
64 @Column(name = "MODEL_INSTANCE_NAME")
65 private String modelInstanceName;
67 @Column(name = "CONFIGURATION_TYPE")
68 private String configurationType;
70 @Column(name = "CONFIGURATION_ROLE")
71 private String configurationRole;
73 @Column(name = "CONFIGURATION_FUNCTION")
74 private String configurationFunction;
76 @Column(name = "POLICY_NAME")
77 private String policyName;
79 @Column(name = "CREATION_TIMESTAMP", updatable = false)
80 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
81 @Temporal(TemporalType.TIMESTAMP)
84 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
85 @JoinColumn(name = "CONFIGURATION_MODEL_UUID")
86 private ConfigurationResource configurationResource;
89 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
90 @JoinColumn(name = "CVNFC_MODEL_CUSTOMIZATION_UUID", referencedColumnName = "MODEL_CUSTOMIZATION_UUID")
91 private CvnfcCustomization cvnfcCustomization;
94 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
95 @JoinColumn(name = "VF_MODULE_MODEL_CUSTOMIZATION_UUID")
96 private VfModuleCustomization vfModuleCustomization;
99 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
100 @JoinColumn(name = "VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID")
101 private VnfResourceCustomization vnfResourceCustomization;
104 public boolean equals(final Object other) {
105 if (!(other instanceof VnfVfmoduleCvnfcConfigurationCustomization)) {
108 VnfVfmoduleCvnfcConfigurationCustomization castOther = (VnfVfmoduleCvnfcConfigurationCustomization) other;
109 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID)
110 .append(cvnfcCustomization, castOther.cvnfcCustomization)
111 .append(vfModuleCustomization, castOther.vfModuleCustomization)
112 .append(vnfResourceCustomization, castOther.vnfResourceCustomization).isEquals();
118 public int hashCode() {
119 return new HashCodeBuilder().append(modelCustomizationUUID).append(cvnfcCustomization)
120 .append(vfModuleCustomization).append(vnfResourceCustomization).toHashCode();
126 public String toString() {
127 return new ToStringBuilder(this).append("id", id).append("modelCustomizationUUID", modelCustomizationUUID)
128 .append("modelInstanceName", modelInstanceName).append("configurationType", configurationType)
129 .append("configurationRole", configurationRole).append("configurationFunction", configurationFunction)
130 .append("policyName", policyName).append("created", created)
131 .append("configurationResource", configurationResource).append("cvnfcCustomization", cvnfcCustomization)
132 .append("vfModuleCustomization", vfModuleCustomization)
133 .append("vnfResourceCustomization", vnfResourceCustomization).toString();
139 protected void onCreate() {
140 this.created = new Date();
143 public Integer getId() {
147 public void setId(Integer id) {
151 public String getModelCustomizationUUID() {
152 return modelCustomizationUUID;
155 public void setModelCustomizationUUID(String modelCustomizationUUID) {
156 this.modelCustomizationUUID = modelCustomizationUUID;
159 public String getModelInstanceName() {
160 return modelInstanceName;
163 public void setModelInstanceName(String modelInstanceName) {
164 this.modelInstanceName = modelInstanceName;
167 public String getConfigurationType() {
168 return configurationType;
171 public void setConfigurationType(String configurationType) {
172 this.configurationType = configurationType;
175 public String getConfigurationRole() {
176 return configurationRole;
179 public void setConfigurationRole(String configurationRole) {
180 this.configurationRole = configurationRole;
183 public String getConfigurationFunction() {
184 return configurationFunction;
187 public void setConfigurationFunction(String configurationFunction) {
188 this.configurationFunction = configurationFunction;
191 public String getPolicyName() {
195 public void setPolicyName(String policyName) {
196 this.policyName = policyName;
199 public Date getCreated() {
203 public void setCreated(Date created) {
204 this.created = created;
208 public ConfigurationResource getConfigurationResource() {
209 return configurationResource;
212 public void setConfigurationResource(ConfigurationResource configurationResource) {
213 this.configurationResource = configurationResource;
217 public CvnfcCustomization getCvnfcCustomization() {
218 return cvnfcCustomization;
221 public void setCvnfcCustomization(CvnfcCustomization cvnfcCustomization) {
222 this.cvnfcCustomization = cvnfcCustomization;
225 public VfModuleCustomization getVfModuleCustomization() {
226 return vfModuleCustomization;
229 public void setVfModuleCustomization(VfModuleCustomization vfModuleCustomization) {
230 this.vfModuleCustomization = vfModuleCustomization;
233 public VnfResourceCustomization getVnfResourceCustomization() {
234 return vnfResourceCustomization;
237 public void setVnfResourceCustomization(VnfResourceCustomization vnfResourceCustomization) {
238 this.vnfResourceCustomization = vnfResourceCustomization;