Replaced all tabs with spaces in java and pom.xml
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / CvnfcConfigurationCustomization.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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
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 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.GeneratedValue;
30 import javax.persistence.GenerationType;
31 import javax.persistence.Id;
32 import javax.persistence.JoinColumn;
33 import javax.persistence.JoinColumns;
34 import javax.persistence.ManyToOne;
35 import javax.persistence.PrePersist;
36 import javax.persistence.Table;
37 import javax.persistence.Temporal;
38 import javax.persistence.TemporalType;
39 import org.apache.commons.lang3.builder.EqualsBuilder;
40 import org.apache.commons.lang3.builder.HashCodeBuilder;
41 import org.apache.commons.lang3.builder.ToStringBuilder;
42 import com.fasterxml.jackson.annotation.JsonFormat;
43 import com.openpojo.business.annotation.BusinessKey;
44 import uk.co.blackpepper.bowman.annotation.LinkedResource;
45
46 @Entity
47 @Table(name = "cvnfc_configuration_customization")
48 public class CvnfcConfigurationCustomization implements Serializable {
49
50     private static final long serialVersionUID = -3153216266280581103L;
51
52     @Id
53     @BusinessKey
54     @Column(name = "ID")
55     @GeneratedValue(strategy = GenerationType.IDENTITY)
56     private Integer id;
57
58     @Column(name = "MODEL_CUSTOMIZATION_UUID")
59     private String modelCustomizationUUID;
60
61     @Column(name = "MODEL_INSTANCE_NAME")
62     private String modelInstanceName;
63
64     @Column(name = "CONFIGURATION_TYPE")
65     private String configurationType;
66
67     @Column(name = "CONFIGURATION_ROLE")
68     private String configurationRole;
69
70     @Column(name = "CONFIGURATION_FUNCTION")
71     private String configurationFunction;
72
73     @Column(name = "POLICY_NAME")
74     private String policyName;
75
76     @Column(name = "CREATION_TIMESTAMP", updatable = false)
77     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
78     @Temporal(TemporalType.TIMESTAMP)
79     private Date created;
80
81     @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
82     @JoinColumn(name = "CONFIGURATION_MODEL_UUID")
83     private ConfigurationResource configurationResource;
84
85     @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
86     @JoinColumn(name = "CVNFC_CUSTOMIZATION_ID")
87     private CvnfcCustomization cvnfcCustomization;
88
89
90     @Override
91     public boolean equals(final Object other) {
92         if (!(other instanceof CvnfcConfigurationCustomization)) {
93             return false;
94         }
95         CvnfcConfigurationCustomization castOther = (CvnfcConfigurationCustomization) other;
96         return new EqualsBuilder().append(id, castOther.id).isEquals();
97     }
98
99
100
101     @Override
102     public int hashCode() {
103         return new HashCodeBuilder().append(id).toHashCode();
104     }
105
106
107
108     @Override
109     public String toString() {
110         return new ToStringBuilder(this).append("id", id).append("modelCustomizationUUID", modelCustomizationUUID)
111                 .append("modelInstanceName", modelInstanceName).append("configurationType", configurationType)
112                 .append("configurationRole", configurationRole).append("configurationFunction", configurationFunction)
113                 .append("policyName", policyName).append("created", created)
114                 .append("configurationResource", configurationResource).append("cvnfcCustomization", cvnfcCustomization)
115                 .toString();
116     }
117
118
119
120     @PrePersist
121     protected void onCreate() {
122         this.created = new Date();
123     }
124
125     public Integer getId() {
126         return id;
127     }
128
129     public void setId(Integer id) {
130         this.id = id;
131     }
132
133     public String getModelCustomizationUUID() {
134         return modelCustomizationUUID;
135     }
136
137     public void setModelCustomizationUUID(String modelCustomizationUUID) {
138         this.modelCustomizationUUID = modelCustomizationUUID;
139     }
140
141     public String getModelInstanceName() {
142         return modelInstanceName;
143     }
144
145     public void setModelInstanceName(String modelInstanceName) {
146         this.modelInstanceName = modelInstanceName;
147     }
148
149     public String getConfigurationType() {
150         return configurationType;
151     }
152
153     public void setConfigurationType(String configurationType) {
154         this.configurationType = configurationType;
155     }
156
157     public String getConfigurationRole() {
158         return configurationRole;
159     }
160
161     public void setConfigurationRole(String configurationRole) {
162         this.configurationRole = configurationRole;
163     }
164
165     public String getConfigurationFunction() {
166         return configurationFunction;
167     }
168
169     public void setConfigurationFunction(String configurationFunction) {
170         this.configurationFunction = configurationFunction;
171     }
172
173     public String getPolicyName() {
174         return policyName;
175     }
176
177     public void setPolicyName(String policyName) {
178         this.policyName = policyName;
179     }
180
181     public Date getCreated() {
182         return created;
183     }
184
185     public void setCreated(Date created) {
186         this.created = created;
187     }
188
189     @LinkedResource
190     public ConfigurationResource getConfigurationResource() {
191         return configurationResource;
192     }
193
194     public void setConfigurationResource(ConfigurationResource configurationResource) {
195         this.configurationResource = configurationResource;
196     }
197
198     @LinkedResource
199     public CvnfcCustomization getCvnfcCustomization() {
200         return cvnfcCustomization;
201     }
202
203     public void setCvnfcCustomization(CvnfcCustomization cvnfcCustomization) {
204         this.cvnfcCustomization = cvnfcCustomization;
205     }
206
207 }