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.OneToMany;
36 import javax.persistence.PrePersist;
37 import javax.persistence.Table;
38 import javax.persistence.Temporal;
39 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;
43 import com.fasterxml.jackson.annotation.JsonFormat;
44 import com.openpojo.business.annotation.BusinessKey;
45 import uk.co.blackpepper.bowman.annotation.LinkedResource;
48 @Table(name = "cvnfc_customization")
49 public class CvnfcCustomization implements Serializable {
51 private static final long serialVersionUID = -3772469944364616486L;
56 @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 = "MODEL_UUID")
66 private String modelUUID;
68 @Column(name = "MODEL_INVARIANT_UUID")
69 private String modelInvariantUUID;
71 @Column(name = "MODEL_VERSION")
72 private String modelVersion;
74 @Column(name = "MODEL_NAME")
75 private String modelName;
77 @Column(name = "TOSCA_NODE_TYPE")
78 private String toscaNodeType;
80 @Column(name = "DESCRIPTION")
81 private String description;
83 @Column(name = "NFC_FUNCTION")
84 private String nfcFunction;
86 @Column(name = "NFC_NAMING_CODE")
87 private String nfcNamingCode;
89 @Column(name = "CREATION_TIMESTAMP", updatable = false)
90 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
91 @Temporal(TemporalType.TIMESTAMP)
94 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
95 @JoinColumn(name = "VF_MODULE_CUSTOMIZATION_ID")
96 private VfModuleCustomization vfModuleCustomization;
98 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
99 @JoinColumn(name = "VNFC_CUST_MODEL_CUSTOMIZATION_UUID")
100 private VnfcCustomization vnfcCustomization;
102 @OneToMany(cascade = CascadeType.ALL, mappedBy = "cvnfcCustomization")
103 private Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization;
106 public boolean equals(final Object other) {
107 if (!(other instanceof CvnfcCustomization)) {
110 CvnfcCustomization castOther = (CvnfcCustomization) other;
111 return new EqualsBuilder().append(id, castOther.id).isEquals();
115 public int hashCode() {
116 return new HashCodeBuilder().append(id).toHashCode();
120 public String toString() {
121 return new ToStringBuilder(this).append("id", id).append("modelCustomizationUUID", modelCustomizationUUID)
122 .append("modelInstanceName", modelInstanceName).append("modelUUID", modelUUID)
123 .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion)
124 .append("modelName", modelName).append("toscaNodeType", toscaNodeType)
125 .append("description", description).append("nfcFunction", nfcFunction)
126 .append("nfcNamingCode", nfcNamingCode).append("created", created)
127 .append("vnfVfmoduleCvnfcConfigurationCustomization", cvnfcConfigurationCustomization).toString();
131 public VnfcCustomization getVnfcCustomization() {
132 return vnfcCustomization;
135 public void setVnfcCustomization(VnfcCustomization vnfcCustomization) {
136 this.vnfcCustomization = vnfcCustomization;
140 protected void onCreate() {
141 this.created = new Date();
145 public Set<CvnfcConfigurationCustomization> getCvnfcConfigurationCustomization() {
146 return cvnfcConfigurationCustomization;
149 public void setCvnfcConfigurationCustomization(
150 Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization) {
151 this.cvnfcConfigurationCustomization = cvnfcConfigurationCustomization;
154 public Integer getId() {
158 public void setId(Integer id) {
162 public String getModelCustomizationUUID() {
163 return modelCustomizationUUID;
166 public void setModelCustomizationUUID(String modelCustomizationUUID) {
167 this.modelCustomizationUUID = modelCustomizationUUID;
170 public String getModelInstanceName() {
171 return modelInstanceName;
174 public void setModelInstanceName(String modelInstanceName) {
175 this.modelInstanceName = modelInstanceName;
178 public String getModelUUID() {
182 public void setModelUUID(String modelUUID) {
183 this.modelUUID = modelUUID;
186 public String getModelInvariantUUID() {
187 return modelInvariantUUID;
190 public void setModelInvariantUUID(String modelInvariantUUID) {
191 this.modelInvariantUUID = modelInvariantUUID;
194 public String getModelVersion() {
198 public void setModelVersion(String modelVersion) {
199 this.modelVersion = modelVersion;
202 public String getModelName() {
206 public void setModelName(String modelName) {
207 this.modelName = modelName;
210 public String getToscaNodeType() {
211 return toscaNodeType;
214 public void setToscaNodeType(String toscaNodeType) {
215 this.toscaNodeType = toscaNodeType;
218 public String getDescription() {
222 public void setDescription(String description) {
223 this.description = description;
226 public String getNfcFunction() {
230 public void setNfcFunction(String nfcFunction) {
231 this.nfcFunction = nfcFunction;
234 public String getNfcNamingCode() {
235 return nfcNamingCode;
238 public void setNfcNamingCode(String nfcNamingCode) {
239 this.nfcNamingCode = nfcNamingCode;
242 public Date getCreated() {
246 public void setCreated(Date created) {
247 this.created = created;
251 public VfModuleCustomization getVfModuleCustomization() {
252 return vfModuleCustomization;
255 public void setVfModuleCustomization(VfModuleCustomization vfModuleCustomization) {
256 this.vfModuleCustomization = vfModuleCustomization;