SitePage.java
2.14 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
83
84
85
86
87
88
89
90
91
92
93
94
package fi.insomnia.bortal.model;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.eclipse.persistence.annotations.PrivateOwned;
@Entity
@Table(name = "site_pages", uniqueConstraints = @UniqueConstraint(columnNames = { "event_id", "name" }))
public class SitePage extends GenericEntity {
private static final long serialVersionUID = -4333555423866132524L;
public static final String EVENT_ID_COLUMN = "event_id";
@ManyToOne()
@JoinColumn(name = EVENT_ID_COLUMN, nullable = false)
private LanEvent event;
@Column(nullable = false)
private String name;
@ManyToOne()
private SitePage parent;
@ManyToMany()
@PrivateOwned
private List<Role> allowedRoles;
@OneToMany(mappedBy = "parent", cascade = CascadeType.ALL)
private List<SitePage> children;
@PrivateOwned
@OneToMany(mappedBy = "sitepage", cascade = CascadeType.ALL)
private List<PageContent> contents;
public LanEvent getEvent() {
return event;
}
public void setEvent(LanEvent event) {
this.event = event;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public SitePage getParent() {
return parent;
}
public void setParent(SitePage parent) {
this.parent = parent;
}
public List<SitePage> getChildren() {
return children;
}
public void setChildren(List<SitePage> children) {
this.children = children;
}
public List<PageContent> getContents() {
return contents;
}
public void setContents(List<PageContent> contents) {
this.contents = contents;
}
public List<Role> getAllowedRoles() {
return allowedRoles;
}
public void setAllowedRoles(List<Role> allowedRoles) {
this.allowedRoles = allowedRoles;
}
}