1
|
package eu.dnetlib.goldoa.domain;
|
2
|
|
3
|
import com.google.gwt.user.client.rpc.IsSerializable;
|
4
|
|
5
|
import javax.persistence.*;
|
6
|
import java.sql.Timestamp;
|
7
|
import java.util.ArrayList;
|
8
|
import java.util.List;
|
9
|
|
10
|
|
11
|
/**
|
12
|
* The persistent class for the request database table.
|
13
|
*
|
14
|
*/
|
15
|
@Entity
|
16
|
@NamedQuery(name="Request.findAll", query="SELECT r FROM Request r")
|
17
|
public class Request implements IsSerializable {
|
18
|
private static final long serialVersionUID = 1L;
|
19
|
|
20
|
public enum RequestStatus implements IsSerializable {
|
21
|
|
22
|
INCOMPLETE("Incomplete", 0),
|
23
|
SUBMITTED("Submitted", 1),
|
24
|
CONDITIONALLY_APPROVED("Conditionally approved", 2),
|
25
|
APPROVED("Approved", 4),
|
26
|
REJECTED("Rejected", 8),
|
27
|
ACCOUNTING_PROCESSING("Processing payment", 16),
|
28
|
ACCOUNTING_PAID("Paid", 32),
|
29
|
ACCOUNTING_ON_HOLD("On hold", 64),
|
30
|
ACCOUNTING_DENIED("Denied", 128),
|
31
|
COMPLETED("Completed", 256),
|
32
|
|
33
|
LIBRARY_FUND_SUBMITTED("Submitted (Library block grant)", 512),
|
34
|
PUBLISHER_FUND_SUBMITTED("Submitted (Publihser block grant)", 1024),
|
35
|
|
36
|
LIBRARY_FUND_PAID("Paid (Library block grant)", 2048),
|
37
|
PUBLISHER_FUND_PAID("Paid (Publihser block grant)", 4096);
|
38
|
|
39
|
private String value;
|
40
|
private int code;
|
41
|
|
42
|
RequestStatus(String value, int code) {
|
43
|
this.value = value;
|
44
|
this.code = code;
|
45
|
}
|
46
|
|
47
|
public String getValue() {
|
48
|
return value;
|
49
|
}
|
50
|
|
51
|
public int getCode() {
|
52
|
return code;
|
53
|
}
|
54
|
|
55
|
public static RequestStatus forStatus(int status) {
|
56
|
if (status == 0)
|
57
|
return INCOMPLETE;
|
58
|
else
|
59
|
return RequestStatus.values()[((int) Math.round(Math.log(status)/Math.log(2)) + 1)];
|
60
|
}
|
61
|
|
62
|
}
|
63
|
|
64
|
@Id
|
65
|
@Column(columnDefinition = "text")
|
66
|
private String id;
|
67
|
private Float apc;
|
68
|
private Float apcPaid;
|
69
|
private Timestamp approvaldate;
|
70
|
private Timestamp date;
|
71
|
private Timestamp datePaid;
|
72
|
private Float discount;
|
73
|
private Float fundingrequested;
|
74
|
private Float otherCost;
|
75
|
private Float projectparticipation;
|
76
|
private Timestamp submissiondate;
|
77
|
private Float transferCost;
|
78
|
|
79
|
|
80
|
@Column(name="publisher_email",columnDefinition = "text")
|
81
|
private String publisherEmail;
|
82
|
|
83
|
@Transient
|
84
|
private Eligibility eligibility;
|
85
|
|
86
|
@OneToOne(cascade = CascadeType.ALL)
|
87
|
@JoinColumn(name = "bankAccount")
|
88
|
private BankAccount bankAccount;
|
89
|
|
90
|
@OneToOne(cascade = CascadeType.ALL)
|
91
|
@JoinColumn(name = "bankTransferReceipt")
|
92
|
private BankTransferReceipt bankTransferReceipt;
|
93
|
|
94
|
@OneToOne(cascade = CascadeType.ALL)
|
95
|
@JoinColumn(name = "budget")
|
96
|
private Budget budget;
|
97
|
|
98
|
@Basic
|
99
|
@Convert( converter=CurrencyConverter.class )
|
100
|
private Currency currency = Currency.EUR;
|
101
|
|
102
|
@OneToOne(cascade = CascadeType.ALL)
|
103
|
@JoinColumn(name = "invoice")
|
104
|
private Invoice invoice;
|
105
|
|
106
|
@OneToOne
|
107
|
@JoinColumn(name = "journal")
|
108
|
private Journal journal;
|
109
|
|
110
|
@OneToOne
|
111
|
@JoinColumn(name = "organization")
|
112
|
private Organization organization;
|
113
|
|
114
|
@OneToOne
|
115
|
@JoinColumn(name = "project")
|
116
|
private Project project;
|
117
|
|
118
|
@OneToOne
|
119
|
@JoinColumn(name = "publication")
|
120
|
private Publication publication;
|
121
|
|
122
|
@OneToOne
|
123
|
@JoinColumn(name = "publisher")
|
124
|
private Publisher publisher;
|
125
|
|
126
|
@OneToOne
|
127
|
@JoinColumn(name = "researcher")
|
128
|
private User researcher;
|
129
|
|
130
|
@Basic
|
131
|
@Convert( converter=RequestStatusConverter.class )
|
132
|
private RequestStatus status;
|
133
|
|
134
|
@OneToOne
|
135
|
@JoinColumn(name = "\"user\"")
|
136
|
private User user;
|
137
|
|
138
|
@OneToMany(mappedBy = "pk.request",cascade = CascadeType.ALL)
|
139
|
private List<RequestCoFunder> requestCoFunders = new ArrayList<>();
|
140
|
|
141
|
@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
|
142
|
@JoinTable(name = "request_comment", joinColumns = {
|
143
|
@JoinColumn(name = "request", nullable = false, updatable = false)},
|
144
|
inverseJoinColumns = { @JoinColumn(name = "comment",
|
145
|
nullable = false, updatable = false) })
|
146
|
private List<Comment> requestComments = new ArrayList<>();
|
147
|
|
148
|
public Request() {}
|
149
|
|
150
|
public String getId() {
|
151
|
return id;
|
152
|
}
|
153
|
|
154
|
public void setId(String id) {
|
155
|
this.id = id;
|
156
|
}
|
157
|
|
158
|
public Float getApc() {
|
159
|
return apc;
|
160
|
}
|
161
|
|
162
|
public void setApc(Float apc) {
|
163
|
this.apc = apc;
|
164
|
}
|
165
|
|
166
|
public Float getApcPaid() {
|
167
|
return apcPaid;
|
168
|
}
|
169
|
|
170
|
public void setApcPaid(Float apcPaid) {
|
171
|
this.apcPaid = apcPaid;
|
172
|
}
|
173
|
|
174
|
public Timestamp getApprovaldate() {
|
175
|
return approvaldate;
|
176
|
}
|
177
|
|
178
|
public void setApprovaldate(Timestamp approvaldate) {
|
179
|
this.approvaldate = approvaldate;
|
180
|
}
|
181
|
|
182
|
public Timestamp getDate() {
|
183
|
return date;
|
184
|
}
|
185
|
|
186
|
public void setDate(Timestamp date) {
|
187
|
this.date = date;
|
188
|
}
|
189
|
|
190
|
public Timestamp getDatePaid() {
|
191
|
return datePaid;
|
192
|
}
|
193
|
|
194
|
public void setDatePaid(Timestamp datePaid) {
|
195
|
this.datePaid = datePaid;
|
196
|
}
|
197
|
|
198
|
public Float getDiscount() {
|
199
|
return discount;
|
200
|
}
|
201
|
|
202
|
public void setDiscount(Float discount) {
|
203
|
this.discount = discount;
|
204
|
}
|
205
|
|
206
|
public Float getFundingrequested() {
|
207
|
return fundingrequested;
|
208
|
}
|
209
|
|
210
|
public void setFundingrequested(Float fundingrequested) {
|
211
|
this.fundingrequested = fundingrequested;
|
212
|
}
|
213
|
|
214
|
public Float getOtherCost() {
|
215
|
return otherCost;
|
216
|
}
|
217
|
|
218
|
public void setOtherCost(Float otherCost) {
|
219
|
this.otherCost = otherCost;
|
220
|
}
|
221
|
|
222
|
public Float getProjectparticipation() {
|
223
|
return projectparticipation;
|
224
|
}
|
225
|
|
226
|
public void setProjectparticipation(Float projectparticipation) {
|
227
|
this.projectparticipation = projectparticipation;
|
228
|
}
|
229
|
|
230
|
public Timestamp getSubmissiondate() {
|
231
|
return submissiondate;
|
232
|
}
|
233
|
|
234
|
public void setSubmissiondate(Timestamp submissiondate) {
|
235
|
this.submissiondate = submissiondate;
|
236
|
}
|
237
|
|
238
|
public Float getTransferCost() {
|
239
|
return transferCost;
|
240
|
}
|
241
|
|
242
|
public void setTransferCost(Float transferCost) {
|
243
|
this.transferCost = transferCost;
|
244
|
}
|
245
|
|
246
|
public BankAccount getBankAccount() {
|
247
|
return bankAccount;
|
248
|
}
|
249
|
|
250
|
public void setBankAccount(BankAccount bankAccount) {
|
251
|
this.bankAccount = bankAccount;
|
252
|
}
|
253
|
|
254
|
public BankTransferReceipt getBankTransferReceipt() {
|
255
|
return bankTransferReceipt;
|
256
|
}
|
257
|
|
258
|
public void setBankTransferReceipt(BankTransferReceipt bankTransferReceipt) {
|
259
|
this.bankTransferReceipt = bankTransferReceipt;
|
260
|
}
|
261
|
|
262
|
public Budget getBudget() {
|
263
|
return budget;
|
264
|
}
|
265
|
|
266
|
public void setBudget(Budget budget) {
|
267
|
this.budget = budget;
|
268
|
}
|
269
|
|
270
|
public Currency getCurrency() {
|
271
|
return currency;
|
272
|
}
|
273
|
|
274
|
public void setCurrency(Currency currency) {
|
275
|
this.currency = currency;
|
276
|
}
|
277
|
|
278
|
public Invoice getInvoice() {
|
279
|
return invoice;
|
280
|
}
|
281
|
|
282
|
public void setInvoice(Invoice invoice) {
|
283
|
this.invoice = invoice;
|
284
|
}
|
285
|
|
286
|
public Journal getJournal() {
|
287
|
return journal;
|
288
|
}
|
289
|
|
290
|
public void setJournal(Journal journal) {
|
291
|
this.journal = journal;
|
292
|
}
|
293
|
|
294
|
public Organization getOrganization() {
|
295
|
return organization;
|
296
|
}
|
297
|
|
298
|
public void setOrganization(Organization organization) {
|
299
|
this.organization = organization;
|
300
|
}
|
301
|
|
302
|
public Project getProject() {
|
303
|
return project;
|
304
|
}
|
305
|
|
306
|
public void setProject(Project project) {
|
307
|
this.project = project;
|
308
|
}
|
309
|
|
310
|
public Publication getPublication() {
|
311
|
return publication;
|
312
|
}
|
313
|
|
314
|
public void setPublication(Publication publication) {
|
315
|
this.publication = publication;
|
316
|
}
|
317
|
|
318
|
public Publisher getPublisher() {
|
319
|
return publisher;
|
320
|
}
|
321
|
|
322
|
public void setPublisher(Publisher publisher) {
|
323
|
this.publisher = publisher;
|
324
|
}
|
325
|
|
326
|
public User getResearcher() {
|
327
|
return researcher;
|
328
|
}
|
329
|
|
330
|
public void setResearcher(User researcher) {
|
331
|
this.researcher = researcher;
|
332
|
}
|
333
|
|
334
|
public RequestStatus getStatus() {
|
335
|
return status;
|
336
|
}
|
337
|
|
338
|
public void setStatus(RequestStatus status) {
|
339
|
this.status = status;
|
340
|
}
|
341
|
|
342
|
public User getUser() {
|
343
|
return user;
|
344
|
}
|
345
|
|
346
|
public void setUser(User user) {
|
347
|
this.user = user;
|
348
|
}
|
349
|
|
350
|
public List<RequestCoFunder> getRequestCoFunders() {
|
351
|
return requestCoFunders;
|
352
|
}
|
353
|
|
354
|
public void setRequestCoFunders(List<RequestCoFunder> requestCoFunders) {
|
355
|
this.requestCoFunders = requestCoFunders;
|
356
|
}
|
357
|
|
358
|
public List<Comment> getRequestComments() {
|
359
|
return requestComments;
|
360
|
}
|
361
|
|
362
|
public void setRequestComments(List<Comment> requestComments) {
|
363
|
this.requestComments = requestComments;
|
364
|
}
|
365
|
|
366
|
public Eligibility getEligibility() {
|
367
|
return eligibility;
|
368
|
}
|
369
|
|
370
|
public void setEligibility(Eligibility eligibility) {
|
371
|
this.eligibility = eligibility;
|
372
|
}
|
373
|
|
374
|
public String getPublisherEmail() {
|
375
|
return publisherEmail;
|
376
|
}
|
377
|
|
378
|
public void setPublisherEmail(String publisherEmail) {
|
379
|
this.publisherEmail = publisherEmail;
|
380
|
}
|
381
|
|
382
|
|
383
|
}
|