CompoEntry.java
4.42 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.util.Calendar;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
import org.eclipse.persistence.annotations.PrivateOwned;
/**
*
*/
@Entity
@Table(name = "compo_entries")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class CompoEntry extends GenericEntity {
private static final long serialVersionUID = 2L;
@JoinColumn(name = "compo_id", referencedColumnName = "id", nullable = false)
@ManyToOne(optional = false)
private Compo compo;
@Column(name = "entry_created", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Calendar created = Calendar.getInstance();
@Column(name = "title", nullable = false)
private String title;
@Column(name = "author")
private String author;
@Lob
@Column(name = "notes")
private String notes;
@Lob
@Column(name = "screen_message")
private String screenMessage;
@Column(name = "sort")
private Integer sort;
@Column(name = "final_position")
private Integer finalPosition;
@JoinColumn(name = "current_file_id", referencedColumnName = CompoEntryFile.ID_COLUMN)
@OneToOne
private CompoEntryFile currentFile;
@OneToMany(mappedBy = "compoEntry")
private List<Vote> votes;
@PrivateOwned
@OneToMany(cascade = CascadeType.ALL, mappedBy = "entry", fetch = FetchType.LAZY)
private List<CompoEntryFile> files;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "entry")
private List<CompoEntryParticipant> participants;
@JoinColumn(name = "creator_eventuser_id", referencedColumnName = EventUser.ID_COLUMN)
@ManyToOne
private EventUser creator;
public CompoEntry() {
super();
}
public Calendar getCreated() {
return created;
}
public void setCreated(Calendar entryCreated) {
this.created = entryCreated;
}
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
public String getScreenMessage() {
return screenMessage;
}
public void setScreenMessage(String screenMessage) {
this.screenMessage = screenMessage;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public List<Vote> getVotes() {
return votes;
}
public void setVotes(List<Vote> voteList) {
this.votes = voteList;
}
public List<CompoEntryFile> getFiles() {
return files;
}
public void setFiles(List<CompoEntryFile> compoEntryFileList) {
this.files = compoEntryFileList;
}
public List<CompoEntryParticipant> getParticipants() {
return participants;
}
public void setParticipants(
List<CompoEntryParticipant> compoEntryParticipantList) {
this.participants = compoEntryParticipantList;
}
public Compo getCompo() {
return compo;
}
public void setCompo(Compo composId) {
this.compo = composId;
}
public EventUser getCreator() {
return creator;
}
public void setCreator(EventUser creator) {
this.creator = creator;
}
public void setFinalPosition(Integer finalPosition) {
this.finalPosition = finalPosition;
}
public Integer getFinalPosition() {
return finalPosition;
}
public void setCurrentFile(CompoEntryFile currentFile) {
this.currentFile = currentFile;
}
public CompoEntryFile getCurrentFile() {
return currentFile;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
}