DBModel.java
1.22 KB
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
package fi.codecrew.moya.model;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import fi.codecrew.moya.utilities.jpa.ModelInterface;
@Entity
@Table(name = "db_models")
public class DBModel implements ModelInterface {
private static final long serialVersionUID = 5073284536090477221L;
public static final String ID_COLUMN = "id";
@Id
@Column(name = ID_COLUMN, nullable = false)
private Integer id;
@Column(name = "revision", nullable = false)
private Integer revision;
@Column(name = "applied_at")
@Temporal(TemporalType.TIMESTAMP)
private Date appliedAt = new Date();
@Override
public final Integer getId() {
return id;
}
@Override
public final void setId(Integer id) {
this.id = id;
}
public Date getAppliedAt() {
return appliedAt;
}
public void setAppliedAt(Date appliedAt) {
this.appliedAt = appliedAt;
}
public Integer getRevision() {
return revision;
}
public void setRevision(Integer revision) {
this.revision = revision;
}
}