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;
45 @Table(name = "vnfc_customization")
46 public class VnfcCustomization implements Serializable {
48 private static final long serialVersionUID = -3772469944364616486L;
52 @Column(name = "MODEL_CUSTOMIZATION_UUID")
53 private String modelCustomizationUUID;
55 @Column(name = "MODEL_INSTANCE_NAME")
56 private String modelInstanceName;
58 @Column(name = "MODEL_UUID")
59 private String modelUUID;
61 @Column(name = "MODEL_INVARIANT_UUID")
62 private String modelInvariantUUID;
64 @Column(name = "MODEL_VERSION")
65 private String modelVersion;
67 @Column(name = "MODEL_NAME")
68 private String modelName;
70 @Column(name = "TOSCA_NODE_TYPE")
71 private String toscaNodeType;
73 @Column(name = "DESCRIPTION")
74 private String description;
76 @Column(name = "RESOURCE_INPUT")
77 private String resourceInput;
79 @Column(name = "CREATION_TIMESTAMP", updatable = false)
80 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
81 @Temporal(TemporalType.TIMESTAMP)
84 @OneToMany(cascade = CascadeType.ALL, mappedBy = "vnfcCustomization")
85 private List<CvnfcCustomization> cvnfcCustomization;
87 @ManyToOne(cascade = CascadeType.ALL)
88 @JoinColumn(name = "VNFC_INSTANCE_GROUP_CUSTOMIZATION_ID")
89 private VnfcInstanceGroupCustomization vnfcInstanceGroupCustomization;
92 public boolean equals(final Object other) {
93 if (!(other instanceof VnfcCustomization)) {
96 VnfcCustomization castOther = (VnfcCustomization) other;
97 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
101 public int hashCode() {
102 return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
106 public String toString() {
107 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
108 .append("modelInstanceName", modelInstanceName).append("modelUUID", modelUUID)
109 .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion)
110 .append("modelName", modelName).append("toscaNodeType", toscaNodeType)
111 .append("description", description).append("created", created)
112 .append("cvnfcCustomization", cvnfcCustomization).toString();
116 protected void onCreate() {
117 this.created = new Date();
120 public String getModelCustomizationUUID() {
121 return modelCustomizationUUID;
124 public void setModelCustomizationUUID(String modelCustomizationUUID) {
125 this.modelCustomizationUUID = modelCustomizationUUID;
128 public String getModelInstanceName() {
129 return modelInstanceName;
132 public void setModelInstanceName(String modelInstanceName) {
133 this.modelInstanceName = modelInstanceName;
136 public String getModelUUID() {
140 public void setModelUUID(String modelUUID) {
141 this.modelUUID = modelUUID;
144 public String getModelInvariantUUID() {
145 return modelInvariantUUID;
148 public void setModelInvariantUUID(String modelInvariantUUID) {
149 this.modelInvariantUUID = modelInvariantUUID;
152 public String getModelVersion() {
156 public void setModelVersion(String modelVersion) {
157 this.modelVersion = modelVersion;
160 public String getModelName() {
164 public void setModelName(String modelName) {
165 this.modelName = modelName;
168 public String getToscaNodeType() {
169 return toscaNodeType;
172 public void setToscaNodeType(String toscaNodeType) {
173 this.toscaNodeType = toscaNodeType;
176 public String getDescription() {
180 public void setDescription(String description) {
181 this.description = description;
184 public Date getCreated() {
188 public void setCreated(Date created) {
189 this.created = created;
192 public List<CvnfcCustomization> getCvnfcCustomization() {
193 return cvnfcCustomization;
196 public void setCvnfcCustomization(List<CvnfcCustomization> cvnfcCustomization) {
197 this.cvnfcCustomization = cvnfcCustomization;
200 public VnfcInstanceGroupCustomization getVnfcInstanceGroupCustomization() {
201 return vnfcInstanceGroupCustomization;
204 public void setVnfcInstanceGroupCustomization(VnfcInstanceGroupCustomization vnfcInstanceGroupCustomization) {
205 this.vnfcInstanceGroupCustomization = vnfcInstanceGroupCustomization;
208 public String getResourceInput() {
209 return resourceInput;
212 public void setResourceInput(String resourceInput) {
213 this.resourceInput = resourceInput;