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.FetchType;
30 import javax.persistence.GeneratedValue;
31 import javax.persistence.GenerationType;
32 import javax.persistence.Id;
33 import javax.persistence.JoinColumn;
34 import javax.persistence.JoinTable;
35 import javax.persistence.ManyToOne;
36 import javax.persistence.OneToMany;
37 import javax.persistence.OneToOne;
38 import javax.persistence.PrePersist;
39 import javax.persistence.Table;
40 import javax.persistence.Temporal;
41 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;
45 import com.openpojo.business.annotation.BusinessKey;
46 import uk.co.blackpepper.bowman.annotation.LinkedResource;
49 @Table(name = "service_proxy_customization")
50 public class ServiceProxyResourceCustomization implements Serializable {
55 private static final long serialVersionUID = -2822457299134903084L;
59 @Column(name = "MODEL_CUSTOMIZATION_UUID")
60 private String modelCustomizationUUID;
62 @Column(name = "MODEL_INSTANCE_NAME")
63 private String modelInstanceName;
65 @Column(name = "MODEL_UUID")
66 private String modelUUID;
68 @Column(name = "MODEL_INVARIANT_UUID")
69 private String modelInvariantUUID;
71 @Column(name = "MODEL_VERSION")
72 private String modelVersion;
74 @Column(name = "MODEL_NAME")
75 private String modelName;
77 @Column(name = "TOSCA_NODE_TYPE")
78 private String toscaNodeType;
80 @Column(name = "DESCRIPTION")
81 private String description;
83 @Column(name = "CREATION_TIMESTAMP", updatable = false)
84 @Temporal(TemporalType.TIMESTAMP)
87 @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
88 @JoinColumn(name = "SOURCE_SERVICE_MODEL_UUID")
89 private Service sourceService;
92 protected void onCreate() {
93 this.created = new Date();
96 public String getModelCustomizationUUID() {
97 return modelCustomizationUUID;
100 public void setModelCustomizationUUID(String modelCustomizationUUID) {
101 this.modelCustomizationUUID = modelCustomizationUUID;
104 public String getModelInstanceName() {
105 return modelInstanceName;
108 public void setModelInstanceName(String modelInstanceName) {
109 this.modelInstanceName = modelInstanceName;
112 public String getToscaNodeType() {
113 return toscaNodeType;
116 public void setToscaNodeType(String toscaNodeType) {
117 this.toscaNodeType = toscaNodeType;
120 public Date getCreated() {
125 public Service getSourceService() {
126 return sourceService;
129 public void setSourceService(Service sourceService) {
130 this.sourceService = sourceService;
133 public String getModelUUID() {
137 public void setModelUUID(String modelUUID) {
138 this.modelUUID = modelUUID;
141 public String getModelInvariantUUID() {
142 return modelInvariantUUID;
145 public void setModelInvariantUUID(String modelInvariantUUID) {
146 this.modelInvariantUUID = modelInvariantUUID;
149 public String getModelVersion() {
153 public void setModelVersion(String modelVersion) {
154 this.modelVersion = modelVersion;
157 public String getModelName() {
161 public void setModelName(String modelName) {
162 this.modelName = modelName;
165 public String getDescription() {
169 public void setDescription(String description) {
170 this.description = description;
175 public String toString() {
176 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
177 .append("modelInstanceName", modelInstanceName).append("toscaNodeType", toscaNodeType)
178 .append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID)
179 .append("modelName", modelName).append("description", description).append("created", created)
180 .append("sourceService", sourceService).toString();
184 public boolean equals(final Object other) {
185 if (!(other instanceof ServiceProxyResourceCustomization)) {
188 ServiceProxyResourceCustomization castOther = (ServiceProxyResourceCustomization) other;
189 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
193 public int hashCode() {
194 return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();