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.ManyToOne;
13 import javax.persistence.Table;
14 import javax.persistence.Temporal;
15 import javax.persistence.TemporalType;
16
17 import ch.busyboxes.agoo.model.enumeration.WatchedFileState;
18
19
20
21
22
23
24 @Entity
25 @Table(name = "agoo_watched_files")
26 public class WatchedFile {
27
28
29 @Id
30 @GeneratedValue
31 private Long id;
32
33
34 @Basic(optional = false)
35 private String filename;
36
37
38 @Basic
39 private String md5Hash;
40
41
42 @Temporal(TemporalType.TIMESTAMP)
43 private Date lastCheck;
44
45
46 @Column(nullable = false)
47 @Enumerated(EnumType.STRING)
48 private WatchedFileState watchedFileState;
49
50
51 @ManyToOne
52 private WatchedFolder watchedFolder;
53
54
55
56
57
58
59 public Long getId() {
60 return id;
61 }
62
63
64
65
66
67
68 public String getFilename() {
69 return filename;
70 }
71
72
73
74
75
76
77 public void setFilename(String filename) {
78 this.filename = filename;
79 }
80
81
82
83
84
85
86 public String getMd5Hash() {
87 return md5Hash;
88 }
89
90
91
92
93
94
95 public void setMd5Hash(String md5Hash) {
96 this.md5Hash = md5Hash;
97 }
98
99
100
101
102
103
104 public Date getLastCheck() {
105 return lastCheck;
106 }
107
108
109
110
111
112
113 public void setLastCheck(Date lastCheck) {
114 this.lastCheck = lastCheck;
115 }
116
117
118
119
120
121
122 public WatchedFolder getWatchedFolder() {
123 return watchedFolder;
124 }
125
126
127
128
129
130
131 public void setWatchedFolder(WatchedFolder watchedFolder) {
132 this.watchedFolder = watchedFolder;
133 }
134
135
136
137
138
139
140 public WatchedFileState getWatchedFileState() {
141 return watchedFileState;
142 }
143
144
145
146
147
148
149 public void setWatchedFileState(WatchedFileState watchedFileState) {
150 this.watchedFileState = watchedFileState;
151 }
152 }