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;
26 import javax.persistence.CascadeType;
27 import javax.persistence.Column;
28 import javax.persistence.Entity;
29 import javax.persistence.Id;
30 import javax.persistence.OneToMany;
31 import javax.persistence.PrePersist;
32 import javax.persistence.Table;
33 import javax.persistence.Temporal;
34 import javax.persistence.TemporalType;
35 import com.fasterxml.jackson.annotation.JsonFormat;
36 import com.openpojo.business.annotation.BusinessKey;
37 import org.apache.commons.lang3.builder.HashCodeBuilder;
38 import org.apache.commons.lang3.builder.EqualsBuilder;
39 import org.apache.commons.lang3.builder.ToStringBuilder;
42 @Table(name = "vnfc_customization")
43 public class VnfcCustomization implements Serializable {
45 private static final long serialVersionUID = -3772469944364616486L;
49 @Column(name = "MODEL_CUSTOMIZATION_UUID")
50 private String modelCustomizationUUID;
52 @Column(name = "MODEL_INSTANCE_NAME")
53 private String modelInstanceName;
55 @Column(name = "MODEL_UUID")
56 private String modelUUID;
58 @Column(name = "MODEL_INVARIANT_UUID")
59 private String modelInvariantUUID;
61 @Column(name = "MODEL_VERSION")
62 private String modelVersion;
64 @Column(name = "MODEL_NAME")
65 private String modelName;
67 @Column(name = "TOSCA_NODE_TYPE")
68 private String toscaNodeType;
70 @Column(name = "DESCRIPTION")
71 private String description;
73 @Column(name = "CREATION_TIMESTAMP", updatable = false)
74 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
75 @Temporal(TemporalType.TIMESTAMP)
78 @OneToMany(cascade = CascadeType.ALL, mappedBy = "vnfcCustomization")
79 private List<CvnfcCustomization> cvnfcCustomization;
82 public boolean equals(final Object other) {
83 if (!(other instanceof VnfcCustomization)) {
86 VnfcCustomization castOther = (VnfcCustomization) other;
87 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
91 public int hashCode() {
92 return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
96 public String toString() {
97 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
98 .append("modelInstanceName", modelInstanceName).append("modelUUID", modelUUID)
99 .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion)
100 .append("modelName", modelName).append("toscaNodeType", toscaNodeType)
101 .append("description", description).append("created", created)
102 .append("cvnfcCustomization", cvnfcCustomization).toString();
106 protected void onCreate() {
107 this.created = new Date();
110 public String getModelCustomizationUUID() {
111 return modelCustomizationUUID;
114 public void setModelCustomizationUUID(String modelCustomizationUUID) {
115 this.modelCustomizationUUID = modelCustomizationUUID;
118 public String getModelInstanceName() {
119 return modelInstanceName;
122 public void setModelInstanceName(String modelInstanceName) {
123 this.modelInstanceName = modelInstanceName;
126 public String getModelUUID() {
130 public void setModelUUID(String modelUUID) {
131 this.modelUUID = modelUUID;
134 public String getModelInvariantUUID() {
135 return modelInvariantUUID;
138 public void setModelInvariantUUID(String modelInvariantUUID) {
139 this.modelInvariantUUID = modelInvariantUUID;
142 public String getModelVersion() {
146 public void setModelVersion(String modelVersion) {
147 this.modelVersion = modelVersion;
150 public String getModelName() {
154 public void setModelName(String modelName) {
155 this.modelName = modelName;
158 public String getToscaNodeType() {
159 return toscaNodeType;
162 public void setToscaNodeType(String toscaNodeType) {
163 this.toscaNodeType = toscaNodeType;
166 public String getDescription() {
170 public void setDescription(String description) {
171 this.description = description;
174 public Date getCreated() {
178 public void setCreated(Date created) {
179 this.created = created;
182 public List<CvnfcCustomization> getCvnfcCustomization() {
183 return cvnfcCustomization;
186 public void setCvnfcCustomization(List<CvnfcCustomization> cvnfcCustomization) {
187 this.cvnfcCustomization = cvnfcCustomization;