2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright (C) 2019 Huawei Intellectual Property. All rights reserved.
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package org.onap.so.db.catalog.beans;
24 import com.fasterxml.jackson.annotation.JsonFormat;
25 import com.openpojo.business.annotation.BusinessKey;
26 import org.apache.commons.lang3.builder.EqualsBuilder;
27 import org.apache.commons.lang3.builder.HashCodeBuilder;
28 import org.apache.commons.lang3.builder.ToStringBuilder;
29 import javax.persistence.CascadeType;
30 import javax.persistence.Column;
31 import javax.persistence.Entity;
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 java.io.Serializable;
41 import java.util.Date;
42 import java.util.List;
43 import uk.co.blackpepper.bowman.annotation.RemoteResource;
46 @RemoteResource("/vnfcCustomization")
47 @Table(name = "vnfc_customization")
48 public class VnfcCustomization implements Serializable {
50 private static final long serialVersionUID = -3772469944364616486L;
54 @Column(name = "MODEL_CUSTOMIZATION_UUID")
55 private String modelCustomizationUUID;
57 @Column(name = "MODEL_INSTANCE_NAME")
58 private String modelInstanceName;
60 @Column(name = "MODEL_UUID")
61 private String modelUUID;
63 @Column(name = "MODEL_INVARIANT_UUID")
64 private String modelInvariantUUID;
66 @Column(name = "MODEL_VERSION")
67 private String modelVersion;
69 @Column(name = "MODEL_NAME")
70 private String modelName;
72 @Column(name = "TOSCA_NODE_TYPE")
73 private String toscaNodeType;
75 @Column(name = "DESCRIPTION")
76 private String description;
78 @Column(name = "RESOURCE_INPUT")
79 private String resourceInput;
81 @Column(name = "CREATION_TIMESTAMP", updatable = false)
82 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
83 @Temporal(TemporalType.TIMESTAMP)
86 @OneToMany(cascade = CascadeType.ALL, mappedBy = "vnfcCustomization")
87 private List<CvnfcCustomization> cvnfcCustomization;
89 @ManyToOne(cascade = CascadeType.ALL)
90 @JoinColumn(name = "VNFC_INSTANCE_GROUP_CUSTOMIZATION_ID")
91 private VnfcInstanceGroupCustomization vnfcInstanceGroupCustomization;
94 public boolean equals(final Object other) {
95 if (!(other instanceof VnfcCustomization)) {
98 VnfcCustomization castOther = (VnfcCustomization) other;
99 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
103 public int hashCode() {
104 return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
108 public String toString() {
109 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
110 .append("modelInstanceName", modelInstanceName).append("modelUUID", modelUUID)
111 .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion)
112 .append("modelName", modelName).append("toscaNodeType", toscaNodeType)
113 .append("description", description).append("created", created)
114 .append("cvnfcCustomization", cvnfcCustomization).toString();
118 protected void onCreate() {
119 this.created = new Date();
122 public String getModelCustomizationUUID() {
123 return modelCustomizationUUID;
126 public void setModelCustomizationUUID(String modelCustomizationUUID) {
127 this.modelCustomizationUUID = modelCustomizationUUID;
130 public String getModelInstanceName() {
131 return modelInstanceName;
134 public void setModelInstanceName(String modelInstanceName) {
135 this.modelInstanceName = modelInstanceName;
138 public String getModelUUID() {
142 public void setModelUUID(String modelUUID) {
143 this.modelUUID = modelUUID;
146 public String getModelInvariantUUID() {
147 return modelInvariantUUID;
150 public void setModelInvariantUUID(String modelInvariantUUID) {
151 this.modelInvariantUUID = modelInvariantUUID;
154 public String getModelVersion() {
158 public void setModelVersion(String modelVersion) {
159 this.modelVersion = modelVersion;
162 public String getModelName() {
166 public void setModelName(String modelName) {
167 this.modelName = modelName;
170 public String getToscaNodeType() {
171 return toscaNodeType;
174 public void setToscaNodeType(String toscaNodeType) {
175 this.toscaNodeType = toscaNodeType;
178 public String getDescription() {
182 public void setDescription(String description) {
183 this.description = description;
186 public Date getCreated() {
190 public void setCreated(Date created) {
191 this.created = created;
194 public List<CvnfcCustomization> getCvnfcCustomization() {
195 return cvnfcCustomization;
198 public void setCvnfcCustomization(List<CvnfcCustomization> cvnfcCustomization) {
199 this.cvnfcCustomization = cvnfcCustomization;
202 public VnfcInstanceGroupCustomization getVnfcInstanceGroupCustomization() {
203 return vnfcInstanceGroupCustomization;
206 public void setVnfcInstanceGroupCustomization(VnfcInstanceGroupCustomization vnfcInstanceGroupCustomization) {
207 this.vnfcInstanceGroupCustomization = vnfcInstanceGroupCustomization;
210 public String getResourceInput() {
211 return resourceInput;
214 public void setResourceInput(String resourceInput) {
215 this.resourceInput = resourceInput;