[SO] Release so 1.13.0 image
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / ServiceInfo.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (c) 2019, CMCC Technologies Co., Ltd.
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.onap.so.db.catalog.beans;
22
23 import com.openpojo.business.annotation.BusinessKey;
24 import org.apache.commons.lang3.builder.ToStringBuilder;
25 import uk.co.blackpepper.bowman.annotation.LinkedResource;
26 import javax.persistence.*;
27 import java.io.Serializable;
28 import java.util.Objects;
29
30 @Entity
31 @Table(name = "service_info")
32 public class ServiceInfo implements Serializable {
33
34     private static final long serialVersionUID = 768026109321305392L;
35
36     @Id
37     @BusinessKey
38     @GeneratedValue(strategy = GenerationType.IDENTITY)
39     @Column(name = "ID")
40     private Integer id;
41
42     @Column(name = "SERVICE_INPUT")
43     private String serviceInput;
44
45     @Column(name = "SERVICE_PROPERTIES")
46     private String serviceProperties;
47
48     @ManyToOne(cascade = CascadeType.ALL)
49     @JoinColumn(name = "SERVICE_MODEL_UUID")
50     private Service service;
51
52     public Integer getId() {
53         return id;
54     }
55
56     public void setId(Integer serviceInfoId) {
57         this.id = serviceInfoId;
58     }
59
60     public String getServiceInput() {
61         return serviceInput;
62     }
63
64     public void setServiceInput(String serviceInput) {
65         this.serviceInput = serviceInput;
66     }
67
68     public String getServiceProperties() {
69         return serviceProperties;
70     }
71
72     public void setServiceProperties(String serviceProperties) {
73         this.serviceProperties = serviceProperties;
74     }
75
76     @LinkedResource
77     public Service getService() {
78         return service;
79     }
80
81     public void setService(Service service) {
82         this.service = service;
83     }
84
85     @Override
86     public String toString() {
87         return new ToStringBuilder(this).append("id", id).append("serviceProperties", serviceProperties)
88                 .append("serviceInput", serviceInput).toString();
89     }
90
91     @Override
92     public boolean equals(Object o) {
93         if (this == o)
94             return true;
95         if (o == null || getClass() != o.getClass())
96             return false;
97         ServiceInfo that = (ServiceInfo) o;
98         return id.equals(that.id);
99     }
100
101     @Override
102     public int hashCode() {
103         return Objects.hash(id);
104     }
105 }