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;
25 import java.util.List;
27 import javax.persistence.CascadeType;
28 import javax.persistence.Column;
29 import javax.persistence.Entity;
30 import javax.persistence.Id;
31 import javax.persistence.OneToMany;
32 import javax.persistence.PrePersist;
33 import javax.persistence.Table;
34 import javax.persistence.Temporal;
35 import javax.persistence.TemporalType;
37 import com.fasterxml.jackson.annotation.JsonFormat;
38 import com.openpojo.business.annotation.BusinessKey;
39 import org.apache.commons.lang3.builder.HashCodeBuilder;
40 import org.apache.commons.lang3.builder.EqualsBuilder;
41 import org.apache.commons.lang3.builder.ToStringBuilder;
44 @Table(name = "vnfc_customization")
45 public class VnfcCustomization implements Serializable {
47 private static final long serialVersionUID = -3772469944364616486L;
51 @Column(name = "MODEL_CUSTOMIZATION_UUID")
52 private String modelCustomizationUUID;
54 @Column(name = "MODEL_INSTANCE_NAME")
55 private String modelInstanceName;
57 @Column(name = "MODEL_UUID")
58 private String modelUUID;
60 @Column(name = "MODEL_INVARIANT_UUID")
61 private String modelInvariantUUID;
63 @Column(name = "MODEL_VERSION")
64 private String modelVersion;
66 @Column(name = "MODEL_NAME")
67 private String modelName;
69 @Column(name = "TOSCA_NODE_TYPE")
70 private String toscaNodeType;
72 @Column(name = "DESCRIPTION")
73 private String description;
75 @Column(name = "CREATION_TIMESTAMP", updatable = false)
76 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
77 @Temporal(TemporalType.TIMESTAMP)
80 @OneToMany(cascade = CascadeType.ALL, mappedBy = "vnfcCustomization")
81 private List<CvnfcCustomization> cvnfcCustomization;
84 public boolean equals(final Object other) {
85 if (!(other instanceof VnfcCustomization)) {
88 VnfcCustomization castOther = (VnfcCustomization) other;
89 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
93 public int hashCode() {
94 return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
98 public String toString() {
99 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
100 .append("modelInstanceName", modelInstanceName).append("modelUUID", modelUUID)
101 .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion)
102 .append("modelName", modelName).append("toscaNodeType", toscaNodeType)
103 .append("description", description).append("created", created)
104 .append("cvnfcCustomization", cvnfcCustomization).toString();
108 protected void onCreate() {
109 this.created = new Date();
112 public String getModelCustomizationUUID() {
113 return modelCustomizationUUID;
116 public void setModelCustomizationUUID(String modelCustomizationUUID) {
117 this.modelCustomizationUUID = modelCustomizationUUID;
120 public String getModelInstanceName() {
121 return modelInstanceName;
124 public void setModelInstanceName(String modelInstanceName) {
125 this.modelInstanceName = modelInstanceName;
128 public String getModelUUID() {
132 public void setModelUUID(String modelUUID) {
133 this.modelUUID = modelUUID;
136 public String getModelInvariantUUID() {
137 return modelInvariantUUID;
140 public void setModelInvariantUUID(String modelInvariantUUID) {
141 this.modelInvariantUUID = modelInvariantUUID;
144 public String getModelVersion() {
148 public void setModelVersion(String modelVersion) {
149 this.modelVersion = modelVersion;
152 public String getModelName() {
156 public void setModelName(String modelName) {
157 this.modelName = modelName;
160 public String getToscaNodeType() {
161 return toscaNodeType;
164 public void setToscaNodeType(String toscaNodeType) {
165 this.toscaNodeType = toscaNodeType;
168 public String getDescription() {
172 public void setDescription(String description) {
173 this.description = description;
176 public Date getCreated() {
180 public void setCreated(Date created) {
181 this.created = created;
184 public List<CvnfcCustomization> getCvnfcCustomization() {
185 return cvnfcCustomization;
188 public void setCvnfcCustomization(List<CvnfcCustomization> cvnfcCustomization) {
189 this.cvnfcCustomization = cvnfcCustomization;