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 javax.persistence.CascadeType;
26 import javax.persistence.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.FetchType;
29 import javax.persistence.Id;
30 import javax.persistence.JoinColumn;
31 import javax.persistence.OneToOne;
32 import javax.persistence.PrePersist;
33 import javax.persistence.Table;
34 import javax.persistence.Temporal;
35 import javax.persistence.TemporalType;
36 import org.apache.commons.lang3.builder.EqualsBuilder;
37 import org.apache.commons.lang3.builder.HashCodeBuilder;
38 import org.apache.commons.lang3.builder.ToStringBuilder;
39 import com.openpojo.business.annotation.BusinessKey;
40 import uk.co.blackpepper.bowman.annotation.LinkedResource;
41 import uk.co.blackpepper.bowman.annotation.RemoteResource;
44 @RemoteResource("/serviceProxyResourceCustomization")
45 @Table(name = "service_proxy_customization")
46 public class ServiceProxyResourceCustomization implements Serializable {
51 private static final long serialVersionUID = -2822457299134903084L;
55 @Column(name = "MODEL_CUSTOMIZATION_UUID")
56 private String modelCustomizationUUID;
58 @Column(name = "MODEL_INSTANCE_NAME")
59 private String modelInstanceName;
61 @Column(name = "MODEL_UUID")
62 private String modelUUID;
64 @Column(name = "MODEL_INVARIANT_UUID")
65 private String modelInvariantUUID;
67 @Column(name = "MODEL_VERSION")
68 private String modelVersion;
70 @Column(name = "MODEL_NAME")
71 private String modelName;
73 @Column(name = "TOSCA_NODE_TYPE")
74 private String toscaNodeType;
76 @Column(name = "DESCRIPTION")
77 private String description;
79 @Column(name = "CREATION_TIMESTAMP", updatable = false)
80 @Temporal(TemporalType.TIMESTAMP)
83 @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
84 @JoinColumn(name = "SOURCE_SERVICE_MODEL_UUID")
85 private Service sourceService;
88 protected void onCreate() {
89 this.created = new Date();
92 public String getModelCustomizationUUID() {
93 return modelCustomizationUUID;
96 public void setModelCustomizationUUID(String modelCustomizationUUID) {
97 this.modelCustomizationUUID = modelCustomizationUUID;
100 public String getModelInstanceName() {
101 return modelInstanceName;
104 public void setModelInstanceName(String modelInstanceName) {
105 this.modelInstanceName = modelInstanceName;
108 public String getToscaNodeType() {
109 return toscaNodeType;
112 public void setToscaNodeType(String toscaNodeType) {
113 this.toscaNodeType = toscaNodeType;
116 public Date getCreated() {
121 public Service getSourceService() {
122 return sourceService;
125 public void setSourceService(Service sourceService) {
126 this.sourceService = sourceService;
129 public String getModelUUID() {
133 public void setModelUUID(String modelUUID) {
134 this.modelUUID = modelUUID;
137 public String getModelInvariantUUID() {
138 return modelInvariantUUID;
141 public void setModelInvariantUUID(String modelInvariantUUID) {
142 this.modelInvariantUUID = modelInvariantUUID;
145 public String getModelVersion() {
149 public void setModelVersion(String modelVersion) {
150 this.modelVersion = modelVersion;
153 public String getModelName() {
157 public void setModelName(String modelName) {
158 this.modelName = modelName;
161 public String getDescription() {
165 public void setDescription(String description) {
166 this.description = description;
171 public String toString() {
172 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
173 .append("modelInstanceName", modelInstanceName).append("toscaNodeType", toscaNodeType)
174 .append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID)
175 .append("modelName", modelName).append("description", description).append("created", created)
176 .append("sourceService", sourceService).toString();
180 public boolean equals(final Object other) {
181 if (!(other instanceof ServiceProxyResourceCustomization)) {
184 ServiceProxyResourceCustomization castOther = (ServiceProxyResourceCustomization) other;
185 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
189 public int hashCode() {
190 return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();