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;
26 import javax.persistence.CascadeType;
27 import javax.persistence.Column;
28 import javax.persistence.Entity;
29 import javax.persistence.FetchType;
30 import javax.persistence.GeneratedValue;
31 import javax.persistence.GenerationType;
32 import javax.persistence.Id;
33 import javax.persistence.IdClass;
34 import javax.persistence.JoinColumn;
35 import javax.persistence.ManyToOne;
36 import javax.persistence.PrePersist;
37 import javax.persistence.Table;
38 import javax.persistence.Temporal;
39 import javax.persistence.TemporalType;
41 import org.apache.commons.lang3.builder.EqualsBuilder;
42 import org.apache.commons.lang3.builder.HashCodeBuilder;
43 import org.apache.commons.lang3.builder.ToStringBuilder;
45 import com.openpojo.business.annotation.BusinessKey;
47 import uk.co.blackpepper.bowman.annotation.LinkedResource;
51 @Table(name = "vnfc_instance_group_customization")
52 public class VnfcInstanceGroupCustomization implements Serializable {
57 private static final long serialVersionUID = -8288218040186901676L;
62 @GeneratedValue(strategy = GenerationType.IDENTITY)
65 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
66 @JoinColumn(name = "VNF_RESOURCE_CUSTOMIZATION_ID")
67 private VnfResourceCustomization vnfResourceCust;
69 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
70 @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID")
71 private InstanceGroup instanceGroup;
73 @Column(name = "FUNCTION")
74 private String function;
76 @Column(name = "DESCRIPTION")
77 private String description;
79 @Column(name = "CREATION_TIMESTAMP", updatable = false)
80 @Temporal(TemporalType.TIMESTAMP)
84 public boolean equals(final Object other) {
85 if (!(other instanceof VnfcInstanceGroupCustomization)) {
88 VnfcInstanceGroupCustomization castOther = (VnfcInstanceGroupCustomization) other;
89 return new EqualsBuilder().append(id, castOther.id).isEquals();
93 public int hashCode() {
94 return new HashCodeBuilder().append(id).toHashCode();
98 public String toString() {
99 return new ToStringBuilder(this)
100 .append("function", function).append("description", description)
101 .append("created", created).toString();
104 public Integer getId() {
108 public void setId(Integer id) {
113 protected void onCreate() {
114 this.created = new Date();
117 public Date getCreated(){
121 public String getFunction() {
125 public void setFunction(String function) {
126 this.function = function;
129 public String getDescription() {
133 public void setDescription(String description) {
134 this.description = description;
137 public void setCreated(Date created) {
138 this.created = created;
142 public VnfResourceCustomization getVnfResourceCust() {
143 return vnfResourceCust;
146 public void setVnfResourceCust(VnfResourceCustomization vnfResourceCust) {
147 this.vnfResourceCust = vnfResourceCust;
151 public InstanceGroup getInstanceGroup() {
152 return instanceGroup;
155 public void setInstanceGroup(InstanceGroup instanceGroup) {
156 this.instanceGroup = instanceGroup;