equal
deleted
inserted
replaced
17 public class Task implements IDatabaseObject { |
17 public class Task implements IDatabaseObject { |
18 |
18 |
19 private static final long serialVersionUID = -4457948503094306717L; |
19 private static final long serialVersionUID = -4457948503094306717L; |
20 |
20 |
21 @Id |
21 @Id |
22 @GeneratedValue(strategy = GenerationType.IDENTITY) |
22 @GeneratedValue |
23 @Column(name = "ID", nullable = false) |
23 @Column(name = "ID", nullable = false) |
24 private Integer id = null; |
24 private Integer id = null; |
25 |
25 |
26 @Column(name = "NAME") |
26 @Column(name = "NAME") |
27 private String name = null; |
27 private String name = null; |
40 if (obj == null) |
40 if (obj == null) |
41 return false; |
41 return false; |
42 if (!(obj instanceof Task)) |
42 if (!(obj instanceof Task)) |
43 return false; |
43 return false; |
44 final Task other = (Task) obj; |
44 final Task other = (Task) obj; |
45 return (this.id == other.id || (this.id != null && this.id.equals(other.id))); |
45 return (getId() == other.getId() || (getId() != null && getId().equals(other.getId()))); |
|
46 } |
|
47 |
|
48 @Override |
|
49 public int hashCode() { |
|
50 if(getId() != null && getId() != 0) |
|
51 return getId().hashCode(); |
|
52 else |
|
53 return super.hashCode(); |
|
54 } |
|
55 |
|
56 @Override |
|
57 public String toString() { |
|
58 return getName(); |
46 } |
59 } |
47 |
60 |
48 public Integer getId() { |
61 public Integer getId() { |
49 return id; |
62 return id; |
50 } |
63 } |