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.FetchType;
31 import javax.persistence.GeneratedValue;
32 import javax.persistence.GenerationType;
33 import javax.persistence.Id;
34 import javax.persistence.JoinColumn;
35 import javax.persistence.JoinTable;
36 import javax.persistence.ManyToOne;
37 import javax.persistence.OneToMany;
38 import javax.persistence.OneToOne;
39 import javax.persistence.PrePersist;
40 import javax.persistence.Table;
41 import javax.persistence.Temporal;
42 import javax.persistence.TemporalType;
44 import org.apache.commons.lang3.builder.EqualsBuilder;
45 import org.apache.commons.lang3.builder.HashCodeBuilder;
46 import org.apache.commons.lang3.builder.ToStringBuilder;
48 import com.openpojo.business.annotation.BusinessKey;
50 import uk.co.blackpepper.bowman.annotation.LinkedResource;
53 @Table(name = "service_proxy_customization")
54 public class ServiceProxyResourceCustomization implements Serializable {
59 private static final long serialVersionUID = -2822457299134903084L;
63 @Column(name = "MODEL_CUSTOMIZATION_UUID")
64 private String modelCustomizationUUID;
66 @Column(name = "MODEL_INSTANCE_NAME")
67 private String modelInstanceName;
69 @Column(name = "MODEL_UUID")
70 private String modelUUID;
72 @Column(name = "MODEL_INVARIANT_UUID")
73 private String modelInvariantUUID;
75 @Column(name = "MODEL_VERSION")
76 private String modelVersion;
78 @Column(name = "MODEL_NAME")
79 private String modelName;
81 @Column(name = "TOSCA_NODE_TYPE")
82 private String toscaNodeType;
84 @Column(name = "DESCRIPTION")
85 private String description;
87 @Column(name = "CREATION_TIMESTAMP", updatable = false)
88 @Temporal(TemporalType.TIMESTAMP)
91 @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
92 @JoinColumn(name = "SOURCE_SERVICE_MODEL_UUID")
93 private Service sourceService;
96 protected void onCreate() {
97 this.created = new Date();
100 public String getModelCustomizationUUID() {
101 return modelCustomizationUUID;
104 public void setModelCustomizationUUID(String modelCustomizationUUID) {
105 this.modelCustomizationUUID = modelCustomizationUUID;
108 public String getModelInstanceName() {
109 return modelInstanceName;
112 public void setModelInstanceName(String modelInstanceName) {
113 this.modelInstanceName = modelInstanceName;
116 public String getToscaNodeType() {
117 return toscaNodeType;
120 public void setToscaNodeType(String toscaNodeType) {
121 this.toscaNodeType = toscaNodeType;
124 public Date getCreated() {
129 public Service getSourceService() {
130 return sourceService;
133 public void setSourceService(Service sourceService) {
134 this.sourceService = sourceService;
137 public String getModelUUID() {
141 public void setModelUUID(String modelUUID) {
142 this.modelUUID = modelUUID;
145 public String getModelInvariantUUID() {
146 return modelInvariantUUID;
149 public void setModelInvariantUUID(String modelInvariantUUID) {
150 this.modelInvariantUUID = modelInvariantUUID;
153 public String getModelVersion() {
157 public void setModelVersion(String modelVersion) {
158 this.modelVersion = modelVersion;
161 public String getModelName() {
165 public void setModelName(String modelName) {
166 this.modelName = modelName;
169 public String getDescription() {
173 public void setDescription(String description) {
174 this.description = description;
179 public String toString() {
180 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
181 .append("modelInstanceName", modelInstanceName).append("toscaNodeType", toscaNodeType)
182 .append("modelUUID", modelUUID)
183 .append("modelInvariantUUID",modelInvariantUUID).append("modelName",modelName)
184 .append("description",description)
185 .append("created", created).append("sourceService", sourceService).toString();
189 public boolean equals(final Object other) {
190 if (!(other instanceof ServiceProxyResourceCustomization)) {
193 ServiceProxyResourceCustomization castOther = (ServiceProxyResourceCustomization) other;
194 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
198 public int hashCode() {
199 return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();