2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 - 2018 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.GeneratedValue;
30 import javax.persistence.GenerationType;
31 import javax.persistence.Id;
32 import javax.persistence.IdClass;
33 import javax.persistence.JoinColumn;
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.openpojo.business.annotation.BusinessKey;
43 import uk.co.blackpepper.bowman.annotation.LinkedResource;
47 @Table(name = "vnfc_instance_group_customization")
48 public class VnfcInstanceGroupCustomization implements Serializable {
53 private static final long serialVersionUID = -8288218040186901676L;
58 @GeneratedValue(strategy = GenerationType.IDENTITY)
61 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
62 @JoinColumn(name = "VNF_RESOURCE_CUSTOMIZATION_ID")
63 private VnfResourceCustomization vnfResourceCust;
65 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
66 @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID")
67 private InstanceGroup instanceGroup;
69 @Column(name = "FUNCTION")
70 private String function;
72 @Column(name = "DESCRIPTION")
73 private String description;
75 @Column(name = "CREATION_TIMESTAMP", updatable = false)
76 @Temporal(TemporalType.TIMESTAMP)
80 public boolean equals(final Object other) {
81 if (!(other instanceof VnfcInstanceGroupCustomization)) {
84 VnfcInstanceGroupCustomization castOther = (VnfcInstanceGroupCustomization) other;
85 return new EqualsBuilder().append(id, castOther.id).isEquals();
89 public int hashCode() {
90 return new HashCodeBuilder().append(id).toHashCode();
94 public String toString() {
95 return new ToStringBuilder(this).append("function", function).append("description", description)
96 .append("created", created).toString();
99 public Integer getId() {
103 public void setId(Integer id) {
108 protected void onCreate() {
109 this.created = new Date();
112 public Date getCreated() {
116 public String getFunction() {
120 public void setFunction(String function) {
121 this.function = function;
124 public String getDescription() {
128 public void setDescription(String description) {
129 this.description = description;
132 public void setCreated(Date created) {
133 this.created = created;
137 public VnfResourceCustomization getVnfResourceCust() {
138 return vnfResourceCust;
141 public void setVnfResourceCust(VnfResourceCustomization vnfResourceCust) {
142 this.vnfResourceCust = vnfResourceCust;
146 public InstanceGroup getInstanceGroup() {
147 return instanceGroup;
150 public void setInstanceGroup(InstanceGroup instanceGroup) {
151 this.instanceGroup = instanceGroup;