-
Notifications
You must be signed in to change notification settings - Fork 170
/
Copy pathTool.java
93 lines (75 loc) · 2.08 KB
/
Tool.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package org.ohdsi.webapi.tool;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
import org.ohdsi.webapi.model.CommonEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.Column;
import java.util.Objects;
@Entity
@Table(name = "tool")
public class Tool extends CommonEntity<Integer> {
@Id
@GenericGenerator(
name = "tool_generator",
strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator",
parameters = {
@Parameter(name = "sequence_name", value = "tool_seq"),
@Parameter(name = "increment_size", value = "1")
}
)
@GeneratedValue(generator = "tool_generator")
private Integer id;
@Column(name = "name")
private String name;
@Column(name = "url")
private String url;
@Column(name = "description")
private String description;
@Column(name = "is_enabled")
private Boolean enabled;
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Boolean getEnabled() {
return enabled;
}
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Tool tool = (Tool) o;
return Objects.equals(name, tool.name);
}
@Override
public int hashCode() {
return Objects.hash(name);
}
}