1 package ch.busyboxes.agoo.model;
2
3 import java.util.Date;
4
5 import javax.persistence.Basic;
6 import javax.persistence.Column;
7 import javax.persistence.Entity;
8 import javax.persistence.EnumType;
9 import javax.persistence.Enumerated;
10 import javax.persistence.GeneratedValue;
11 import javax.persistence.Id;
12 import javax.persistence.Table;
13 import javax.persistence.Temporal;
14 import javax.persistence.TemporalType;
15
16 import ch.busyboxes.agoo.model.enumeration.TaskState;
17 import ch.busyboxes.agoo.model.enumeration.TaskType;
18
19
20
21
22
23
24 @Entity
25 @Table(name = "agoo_watcher_task")
26 public class WatcherTask {
27
28
29 @Id
30 @GeneratedValue
31 private Long id;
32
33
34 @Column(nullable = false)
35 @Enumerated(EnumType.STRING)
36 private TaskType taskType;
37
38
39 @Column(nullable = false)
40 @Enumerated(EnumType.STRING)
41 private TaskState taskState;
42
43
44 @Basic(optional = false)
45 private Long targetId;
46
47
48 @Temporal(TemporalType.TIMESTAMP)
49 private Date created;
50
51
52
53
54
55
56 public Long getId() {
57 return id;
58 }
59
60
61
62
63
64
65 public TaskType getTaskType() {
66 return taskType;
67 }
68
69
70
71
72
73
74 public void setTaskType(TaskType taskType) {
75 this.taskType = taskType;
76 }
77
78
79
80
81
82
83 public TaskState getTaskState() {
84 return taskState;
85 }
86
87
88
89
90
91
92 public void setTaskState(TaskState taskState) {
93 this.taskState = taskState;
94 }
95
96
97
98
99
100
101 public Long getTargetId() {
102 return targetId;
103 }
104
105
106
107
108
109
110 public void setTargetId(Long targetId) {
111 this.targetId = targetId;
112 }
113
114
115
116
117
118
119 public Date getCreated() {
120 return created;
121 }
122
123
124
125
126
127
128 public void setCreated(Date created) {
129 this.created = created;
130 }
131
132
133
134
135 public String toString() {
136 return "WatcherTask {" + id + ", " + taskType + ", " + targetId + "}";
137 }
138
139 }