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;
48 @Table(name = "vnf_vfmodule_cvnfc_configuration_customization")
49 public class VnfVfmoduleCvnfcConfigurationCustomization implements Serializable {
51 private static final long serialVersionUID = -3153216266280581103L;
55 @GeneratedValue(strategy = GenerationType.IDENTITY)
59 @Column(name = "MODEL_CUSTOMIZATION_UUID")
60 private String modelCustomizationUUID;
62 @Column(name = "MODEL_INSTANCE_NAME")
63 private String modelInstanceName;
65 @Column(name = "CONFIGURATION_TYPE")
66 private String configurationType;
68 @Column(name = "CONFIGURATION_ROLE")
69 private String configurationRole;
71 @Column(name = "CONFIGURATION_FUNCTION")
72 private String configurationFunction;
74 @Column(name = "POLICY_NAME")
75 private String policyName;
77 @Column(name = "CREATION_TIMESTAMP", updatable = false)
78 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
79 @Temporal(TemporalType.TIMESTAMP)
82 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
83 @JoinColumn(name = "CONFIGURATION_MODEL_UUID")
84 private ConfigurationResource configurationResource;
87 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
88 @JoinColumn(name = "CVNFC_MODEL_CUSTOMIZATION_UUID", referencedColumnName = "MODEL_CUSTOMIZATION_UUID")
89 private CvnfcCustomization cvnfcCustomization;
92 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
93 @JoinColumn(name = "VF_MODULE_MODEL_CUSTOMIZATION_UUID")
94 private VfModuleCustomization vfModuleCustomization;
97 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
98 @JoinColumn(name = "VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID")
99 private VnfResourceCustomization vnfResourceCustomization;
102 public boolean equals(final Object other) {
103 if (!(other instanceof VnfVfmoduleCvnfcConfigurationCustomization)) {
106 VnfVfmoduleCvnfcConfigurationCustomization castOther = (VnfVfmoduleCvnfcConfigurationCustomization) other;
107 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID)
108 .append(cvnfcCustomization, castOther.cvnfcCustomization)
109 .append(vfModuleCustomization, castOther.vfModuleCustomization)
110 .append(vnfResourceCustomization, castOther.vnfResourceCustomization).isEquals();
116 public int hashCode() {
117 return new HashCodeBuilder().append(modelCustomizationUUID).append(cvnfcCustomization)
118 .append(vfModuleCustomization).append(vnfResourceCustomization).toHashCode();
124 public String toString() {
125 return new ToStringBuilder(this).append("id", id).append("modelCustomizationUUID", modelCustomizationUUID)
126 .append("modelInstanceName", modelInstanceName).append("configurationType", configurationType)
127 .append("configurationRole", configurationRole).append("configurationFunction", configurationFunction)
128 .append("policyName", policyName).append("created", created)
129 .append("configurationResource", configurationResource).append("cvnfcCustomization", cvnfcCustomization)
130 .append("vfModuleCustomization", vfModuleCustomization)
131 .append("vnfResourceCustomization", vnfResourceCustomization).toString();
137 protected void onCreate() {
138 this.created = new Date();
141 public Integer getId() {
145 public void setId(Integer id) {
149 public String getModelCustomizationUUID() {
150 return modelCustomizationUUID;
153 public void setModelCustomizationUUID(String modelCustomizationUUID) {
154 this.modelCustomizationUUID = modelCustomizationUUID;
157 public String getModelInstanceName() {
158 return modelInstanceName;
161 public void setModelInstanceName(String modelInstanceName) {
162 this.modelInstanceName = modelInstanceName;
165 public String getConfigurationType() {
166 return configurationType;
169 public void setConfigurationType(String configurationType) {
170 this.configurationType = configurationType;
173 public String getConfigurationRole() {
174 return configurationRole;
177 public void setConfigurationRole(String configurationRole) {
178 this.configurationRole = configurationRole;
181 public String getConfigurationFunction() {
182 return configurationFunction;
185 public void setConfigurationFunction(String configurationFunction) {
186 this.configurationFunction = configurationFunction;
189 public String getPolicyName() {
193 public void setPolicyName(String policyName) {
194 this.policyName = policyName;
197 public Date getCreated() {
201 public void setCreated(Date created) {
202 this.created = created;
205 public ConfigurationResource getConfigurationResource() {
206 return configurationResource;
209 public void setConfigurationResource(ConfigurationResource configurationResource) {
210 this.configurationResource = configurationResource;
213 public CvnfcCustomization getCvnfcCustomization() {
214 return cvnfcCustomization;
217 public void setCvnfcCustomization(CvnfcCustomization cvnfcCustomization) {
218 this.cvnfcCustomization = cvnfcCustomization;
221 public VfModuleCustomization getVfModuleCustomization() {
222 return vfModuleCustomization;
225 public void setVfModuleCustomization(VfModuleCustomization vfModuleCustomization) {
226 this.vfModuleCustomization = vfModuleCustomization;
229 public VnfResourceCustomization getVnfResourceCustomization() {
230 return vnfResourceCustomization;
233 public void setVnfResourceCustomization(VnfResourceCustomization vnfResourceCustomization) {
234 this.vnfResourceCustomization = vnfResourceCustomization;