PublisherAction.java
2.19 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package org.legrog.entities;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* Pesisted entity for actions made on PublisherVersion
*/
@Entity
public class PublisherAction {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer publisherActionId;
@Enumerated
private ActionType actionType;
@ManyToOne
private Account publisherActionActor;
@ManyToOne
private PublisherVersion publisherVersion;
private Timestamp publisherActionDatetime;
// Simplified access instead of going through PublisherVersion
@ManyToOne
private Publisher publisher;
public void setPublisherActionActor(Account publisherActionActor) {
this.publisherActionActor = publisherActionActor;
}
public void setPublisherActionDatetime(Timestamp publisherActionDatetime) {
this.publisherActionDatetime = publisherActionDatetime;
}
public void setActionType(ActionType actionType) {
this.actionType = actionType;
}
public void setPublisherVersion(PublisherVersion publisherVersion) {
this.publisherVersion = publisherVersion;
}
public void setPublisher(Publisher publisher) {
this.publisher = publisher;
}
public ActionType getActionType() {
return actionType;
}
public Account getPublisherActionActor() {
return publisherActionActor;
}
public PublisherVersion getPublisherVersion() {
return publisherVersion;
}
public Timestamp getPublisherActionDatetime() {
return publisherActionDatetime;
}
public Publisher getPublisher() {
return publisher;
}
public Integer getPublisherActionId() {
return publisherActionId;
}
public void setPublisherActionId(Integer publisherActionId) {
this.publisherActionId = publisherActionId;
}
@Override
public String toString() {
return "publisherActionId = " + publisherActionId + ", actionType = " + actionType +
", publisherActionAuthor = " + publisherActionActor + ", publisherVersion = " + publisherVersion +
", publisherActionDatetime = " + publisherActionDatetime + ", publisher = " + publisher;
}
}