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.JoinColumns;
35 import javax.persistence.ManyToOne;
36 import javax.persistence.PrePersist;
37 import javax.persistence.Table;
38 import javax.persistence.Temporal;
39 import javax.persistence.TemporalType;
41 import org.apache.commons.lang3.builder.EqualsBuilder;
42 import org.apache.commons.lang3.builder.HashCodeBuilder;
43 import org.apache.commons.lang3.builder.ToStringBuilder;
45 import com.fasterxml.jackson.annotation.JsonFormat;
46 import com.openpojo.business.annotation.BusinessKey;
48 import uk.co.blackpepper.bowman.annotation.LinkedResource;
51 @Table(name = "vnf_vfmodule_cvnfc_configuration_customization")
52 public class VnfVfmoduleCvnfcConfigurationCustomization implements Serializable {
54 private static final long serialVersionUID = -3153216266280581103L;
58 @GeneratedValue(strategy = GenerationType.IDENTITY)
62 @Column(name = "MODEL_CUSTOMIZATION_UUID")
63 private String modelCustomizationUUID;
65 @Column(name = "MODEL_INSTANCE_NAME")
66 private String modelInstanceName;
68 @Column(name = "CONFIGURATION_TYPE")
69 private String configurationType;
71 @Column(name = "CONFIGURATION_ROLE")
72 private String configurationRole;
74 @Column(name = "CONFIGURATION_FUNCTION")
75 private String configurationFunction;
77 @Column(name = "POLICY_NAME")
78 private String policyName;
81 @Column(name = "CREATION_TIMESTAMP", updatable = false)
82 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
83 @Temporal(TemporalType.TIMESTAMP)
86 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
87 @JoinColumn(name = "CONFIGURATION_MODEL_UUID")
88 private ConfigurationResource configurationResource;
91 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
92 @JoinColumn(name = "CVNFC_CUSTOMIZATION_ID")
93 private CvnfcCustomization cvnfcCustomization;
96 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
97 @JoinColumn(name = "VF_MODULE_MODEL_CUSTOMIZATION_UUID")
98 private VfModuleCustomization vfModuleCustomization;
101 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
102 @JoinColumn(name = "VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID")
103 private VnfResourceCustomization vnfResourceCustomization;
106 public boolean equals(final Object other) {
107 if (!(other instanceof VnfVfmoduleCvnfcConfigurationCustomization)) {
110 VnfVfmoduleCvnfcConfigurationCustomization castOther = (VnfVfmoduleCvnfcConfigurationCustomization) other;
111 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID)
112 .append(cvnfcCustomization, castOther.cvnfcCustomization)
113 .append(vfModuleCustomization, castOther.vfModuleCustomization)
114 .append(vnfResourceCustomization, castOther.vnfResourceCustomization).isEquals();
120 public int hashCode() {
121 return new HashCodeBuilder().append(modelCustomizationUUID).append(cvnfcCustomization)
122 .append(vfModuleCustomization).append(vnfResourceCustomization).toHashCode();
128 public String toString() {
129 return new ToStringBuilder(this).append("id", id).append("modelCustomizationUUID", modelCustomizationUUID)
130 .append("modelInstanceName", modelInstanceName).append("configurationType", configurationType)
131 .append("configurationRole", configurationRole).append("configurationFunction", configurationFunction)
132 .append("policyName", policyName).append("created", created)
133 .append("configurationResource", configurationResource).append("cvnfcCustomization", cvnfcCustomization)
134 .append("vfModuleCustomization", vfModuleCustomization)
135 .append("vnfResourceCustomization", vnfResourceCustomization).toString();
141 protected void onCreate() {
142 this.created = new Date();
145 public Integer getId() {
149 public void setId(Integer id) {
153 public String getModelCustomizationUUID() {
154 return modelCustomizationUUID;
157 public void setModelCustomizationUUID(String modelCustomizationUUID) {
158 this.modelCustomizationUUID = modelCustomizationUUID;
161 public String getModelInstanceName() {
162 return modelInstanceName;
165 public void setModelInstanceName(String modelInstanceName) {
166 this.modelInstanceName = modelInstanceName;
169 public String getConfigurationType() {
170 return configurationType;
173 public void setConfigurationType(String configurationType) {
174 this.configurationType = configurationType;
177 public String getConfigurationRole() {
178 return configurationRole;
181 public void setConfigurationRole(String configurationRole) {
182 this.configurationRole = configurationRole;
185 public String getConfigurationFunction() {
186 return configurationFunction;
189 public void setConfigurationFunction(String configurationFunction) {
190 this.configurationFunction = configurationFunction;
193 public String getPolicyName() {
197 public void setPolicyName(String policyName) {
198 this.policyName = policyName;
201 public Date getCreated() {
205 public void setCreated(Date created) {
206 this.created = created;
210 public ConfigurationResource getConfigurationResource() {
211 return configurationResource;
214 public void setConfigurationResource(ConfigurationResource configurationResource) {
215 this.configurationResource = configurationResource;
219 public CvnfcCustomization getCvnfcCustomization() {
220 return cvnfcCustomization;
223 public void setCvnfcCustomization(CvnfcCustomization cvnfcCustomization) {
224 this.cvnfcCustomization = cvnfcCustomization;
228 public VfModuleCustomization getVfModuleCustomization() {
229 return vfModuleCustomization;
232 public void setVfModuleCustomization(VfModuleCustomization vfModuleCustomization) {
233 this.vfModuleCustomization = vfModuleCustomization;
237 public VnfResourceCustomization getVnfResourceCustomization() {
238 return vnfResourceCustomization;
241 public void setVnfResourceCustomization(VnfResourceCustomization vnfResourceCustomization) {
242 this.vnfResourceCustomization = vnfResourceCustomization;