1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.apache.mailreaderjpa; |
18 | |
|
19 | |
import java.io.Serializable; |
20 | |
import java.sql.Timestamp; |
21 | |
import javax.persistence.Column; |
22 | |
import javax.persistence.Entity; |
23 | |
import javax.persistence.GeneratedValue; |
24 | |
import javax.persistence.GenerationType; |
25 | |
import javax.persistence.Id; |
26 | |
import javax.persistence.NamedQueries; |
27 | |
import javax.persistence.NamedQuery; |
28 | |
import javax.persistence.Version; |
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
@Entity(name="mailreader_protocols") |
34 | |
@NamedQueries({ |
35 | |
@NamedQuery(name="Protocol.findAll", query="SELECT p FROM mailreader_protocols p") |
36 | |
}) |
37 | |
public class Protocol implements Serializable { |
38 | |
|
39 | |
@Id |
40 | |
@Column(name="protocol_id") |
41 | |
@GeneratedValue(strategy = GenerationType.AUTO) |
42 | |
private Integer id; |
43 | |
|
44 | |
|
45 | 0 | public Protocol() { |
46 | 0 | } |
47 | |
|
48 | |
public Integer getId() { |
49 | 0 | return id; |
50 | |
} |
51 | |
|
52 | |
public void setId(Integer id) { |
53 | 0 | this.id = id; |
54 | 0 | } |
55 | |
|
56 | |
public int hashCode() { |
57 | 0 | if (getId() != null) { |
58 | 0 | return getId().intValue(); |
59 | |
} else { |
60 | 0 | return super.hashCode(); |
61 | |
} |
62 | |
} |
63 | |
|
64 | |
public boolean equals(Object obj) { |
65 | 0 | if ((obj instanceof Protocol) |
66 | |
&& (getId() != null)) { |
67 | 0 | return getId().equals(((Protocol) obj).getId()); |
68 | |
} else { |
69 | 0 | return false; |
70 | |
} |
71 | |
} |
72 | |
|
73 | |
public String toString() { |
74 | 0 | return "org.apache.mailreaderjpa.Protocol[id=" + id + "]"; |
75 | |
} |
76 | |
|
77 | |
@Column(nullable=false) |
78 | |
private String description; |
79 | |
@Column(name="last_update") |
80 | |
@Version() |
81 | |
private Timestamp lastUpdate; |
82 | |
|
83 | |
public String getDescription() { |
84 | 0 | return description; |
85 | |
} |
86 | |
|
87 | |
public void setDescription(String description) { |
88 | 0 | this.description = description; |
89 | 0 | } |
90 | |
|
91 | |
public Timestamp getLastUpdate() { |
92 | 0 | return lastUpdate; |
93 | |
} |
94 | |
|
95 | |
public void setLastUpdate(Timestamp lastUpdate) { |
96 | 0 | this.lastUpdate = lastUpdate; |
97 | 0 | } |
98 | |
|
99 | |
} |