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;
27 import javax.persistence.CascadeType;
28 import javax.persistence.Column;
29 import javax.persistence.Entity;
30 import javax.persistence.FetchType;
31 import javax.persistence.GeneratedValue;
32 import javax.persistence.GenerationType;
33 import javax.persistence.Id;
34 import javax.persistence.JoinColumn;
35 import javax.persistence.ManyToOne;
36 import javax.persistence.OneToMany;
37 import javax.persistence.PrePersist;
38 import javax.persistence.Table;
39 import javax.persistence.Temporal;
40 import javax.persistence.TemporalType;
42 import org.apache.commons.lang3.builder.EqualsBuilder;
43 import org.apache.commons.lang3.builder.HashCodeBuilder;
44 import org.apache.commons.lang3.builder.ToStringBuilder;
46 import com.fasterxml.jackson.annotation.JsonFormat;
47 import com.openpojo.business.annotation.BusinessKey;
49 import uk.co.blackpepper.bowman.annotation.LinkedResource;
52 @Table(name = "cvnfc_customization")
53 public class CvnfcCustomization implements Serializable {
55 private static final long serialVersionUID = -3772469944364616486L;
60 @GeneratedValue(strategy = GenerationType.IDENTITY)
63 @Column(name = "MODEL_CUSTOMIZATION_UUID")
64 private String modelCustomizationUUID;
66 @Column(name = "MODEL_INSTANCE_NAME")
67 private String modelInstanceName;
69 @Column(name = "MODEL_UUID")
70 private String modelUUID;
72 @Column(name = "MODEL_INVARIANT_UUID")
73 private String modelInvariantUUID;
75 @Column(name = "MODEL_VERSION")
76 private String modelVersion;
78 @Column(name = "MODEL_NAME")
79 private String modelName;
81 @Column(name = "TOSCA_NODE_TYPE")
82 private String toscaNodeType;
84 @Column(name = "DESCRIPTION")
85 private String description;
87 @Column(name = "NFC_FUNCTION")
88 private String nfcFunction;
90 @Column(name = "NFC_NAMING_CODE")
91 private String nfcNamingCode;
93 @Column(name = "CREATION_TIMESTAMP", updatable = false)
94 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
95 @Temporal(TemporalType.TIMESTAMP)
98 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
99 @JoinColumn(name = "VF_MODULE_CUSTOMIZATION_ID")
100 private VfModuleCustomization vfModuleCustomization;
102 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
103 @JoinColumn(name = "VNFC_CUST_MODEL_CUSTOMIZATION_UUID")
104 private VnfcCustomization vnfcCustomization;
106 @OneToMany(cascade = CascadeType.ALL, mappedBy = "cvnfcCustomization")
107 private Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization;
110 public boolean equals(final Object other) {
111 if (!(other instanceof CvnfcCustomization)) {
114 CvnfcCustomization castOther = (CvnfcCustomization) other;
115 return new EqualsBuilder().append(id, castOther.id).isEquals();
119 public int hashCode() {
120 return new HashCodeBuilder().append(id).toHashCode();
124 public String toString() {
125 return new ToStringBuilder(this).append("id", id).append("modelCustomizationUUID", modelCustomizationUUID)
126 .append("modelInstanceName", modelInstanceName).append("modelUUID", modelUUID)
127 .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion)
128 .append("modelName", modelName).append("toscaNodeType", toscaNodeType)
129 .append("description", description).append("nfcFunction", nfcFunction)
130 .append("nfcNamingCode", nfcNamingCode).append("created", created)
131 .append("vnfVfmoduleCvnfcConfigurationCustomization", cvnfcConfigurationCustomization)
136 public VnfcCustomization getVnfcCustomization() {
137 return vnfcCustomization;
140 public void setVnfcCustomization(VnfcCustomization vnfcCustomization) {
141 this.vnfcCustomization = vnfcCustomization;
145 protected void onCreate() {
146 this.created = new Date();
150 public Set<CvnfcConfigurationCustomization> getCvnfcConfigurationCustomization() {
151 return cvnfcConfigurationCustomization;
154 public void setCvnfcConfigurationCustomization(Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization) {
155 this.cvnfcConfigurationCustomization = cvnfcConfigurationCustomization;
158 public Integer getId() {
162 public void setId(Integer id) {
166 public String getModelCustomizationUUID() {
167 return modelCustomizationUUID;
170 public void setModelCustomizationUUID(String modelCustomizationUUID) {
171 this.modelCustomizationUUID = modelCustomizationUUID;
174 public String getModelInstanceName() {
175 return modelInstanceName;
178 public void setModelInstanceName(String modelInstanceName) {
179 this.modelInstanceName = modelInstanceName;
182 public String getModelUUID() {
186 public void setModelUUID(String modelUUID) {
187 this.modelUUID = modelUUID;
190 public String getModelInvariantUUID() {
191 return modelInvariantUUID;
194 public void setModelInvariantUUID(String modelInvariantUUID) {
195 this.modelInvariantUUID = modelInvariantUUID;
198 public String getModelVersion() {
202 public void setModelVersion(String modelVersion) {
203 this.modelVersion = modelVersion;
206 public String getModelName() {
210 public void setModelName(String modelName) {
211 this.modelName = modelName;
214 public String getToscaNodeType() {
215 return toscaNodeType;
218 public void setToscaNodeType(String toscaNodeType) {
219 this.toscaNodeType = toscaNodeType;
222 public String getDescription() {
226 public void setDescription(String description) {
227 this.description = description;
230 public String getNfcFunction() {
234 public void setNfcFunction(String nfcFunction) {
235 this.nfcFunction = nfcFunction;
238 public String getNfcNamingCode() {
239 return nfcNamingCode;
242 public void setNfcNamingCode(String nfcNamingCode) {
243 this.nfcNamingCode = nfcNamingCode;
246 public Date getCreated() {
250 public void setCreated(Date created) {
251 this.created = created;
255 public VfModuleCustomization getVfModuleCustomization() {
256 return vfModuleCustomization;
259 public void setVfModuleCustomization(VfModuleCustomization vfModuleCustomization) {
260 this.vfModuleCustomization = vfModuleCustomization;