Correct Catalog DB beans
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / ActivitySpecParameters.java
1 package org.onap.so.db.catalog.beans;
2
3 import java.io.Serializable;
4 import java.util.Date;
5 import javax.persistence.Column;
6 import javax.persistence.Entity;
7 import javax.persistence.GeneratedValue;
8 import javax.persistence.GenerationType;
9 import javax.persistence.Id;
10 import javax.persistence.PrePersist;
11 import javax.persistence.Table;
12 import javax.persistence.Temporal;
13 import javax.persistence.TemporalType;
14 import org.apache.commons.lang3.builder.EqualsBuilder;
15 import org.apache.commons.lang3.builder.HashCodeBuilder;
16 import org.apache.commons.lang3.builder.ToStringBuilder;
17 import com.openpojo.business.annotation.BusinessKey;
18
19 @Entity
20 @Table(name = "ACTIVITY_SPEC_PARAMETERS")
21 public class ActivitySpecParameters implements Serializable {
22
23     private static final long serialVersionUID = 3627711377147710046L;
24
25     @Id
26     @Column(name = "ID", nullable = false, updatable = false)
27     @GeneratedValue(strategy = GenerationType.IDENTITY)
28     private Integer ID;
29
30     @BusinessKey
31     @Column(name = "NAME")
32     private String name;
33
34     @Column(name = "TYPE")
35     private String type;
36
37     @BusinessKey
38     @Column(name = "DIRECTION")
39     private String direction;
40
41     @Column(name = "DESCRIPTION")
42     private String description;
43
44     @Column(name = "CREATION_TIMESTAMP", updatable = false)
45     @Temporal(TemporalType.TIMESTAMP)
46     private Date created;
47
48     @PrePersist
49     protected void onCreate() {
50         this.created = new Date();
51     }
52
53     @Override
54     public String toString() {
55         return new ToStringBuilder(this).append("name", name).append("direction", direction).toString();
56     }
57
58     @Override
59     public boolean equals(final Object other) {
60         if (!(other instanceof ActivitySpecParameters)) {
61             return false;
62         }
63         ActivitySpecParameters castOther = (ActivitySpecParameters) other;
64         return new EqualsBuilder().append(ID, castOther.ID).isEquals();
65     }
66
67     @Override
68     public int hashCode() {
69         return new HashCodeBuilder().append(ID).toHashCode();
70     }
71
72     public Integer getID() {
73         return ID;
74     }
75
76     public String getName() {
77         return name;
78     }
79
80     public void setName(String name) {
81         this.name = name;
82     }
83
84     public String getType() {
85         return type;
86     }
87
88     public void setType(String type) {
89         this.type = type;
90     }
91
92     public String getDirection() {
93         return direction;
94     }
95
96     public void setDirection(String direction) {
97         this.direction = direction;
98     }
99
100     public String getDescription() {
101         return description;
102     }
103
104     public void setDescription(String description) {
105         this.description = description;
106     }
107
108     public Date getCreated() {
109         return created;
110     }
111
112     public void setCreated(Date created) {
113         this.created = created;
114     }
115 }