1
|
package eu.dnetlib.goldoa.domain;
|
2
|
|
3
|
import com.fasterxml.jackson.annotation.JsonBackReference;
|
4
|
import com.google.gwt.user.client.rpc.IsSerializable;
|
5
|
|
6
|
import javax.persistence.*;
|
7
|
import java.sql.Timestamp;
|
8
|
import java.util.ArrayList;
|
9
|
import java.util.List;
|
10
|
|
11
|
|
12
|
/**
|
13
|
* The persistent class for the comment database table.
|
14
|
*
|
15
|
*/
|
16
|
@Entity
|
17
|
public class Comment implements IsSerializable {
|
18
|
private static final long serialVersionUID = 1L;
|
19
|
|
20
|
@Column(columnDefinition = "text")
|
21
|
private String comment;
|
22
|
|
23
|
private Timestamp date;
|
24
|
@Id
|
25
|
@Column(columnDefinition = "text")
|
26
|
private String id;
|
27
|
|
28
|
@OneToOne
|
29
|
@JoinColumn(name = "\"user\"",columnDefinition = "text default 'portal::ac6219edefc92a45b233f83e975102ec'")
|
30
|
private User user;
|
31
|
|
32
|
@OneToOne
|
33
|
@JoinColumn(name = "template")
|
34
|
private CommentTemplate template;
|
35
|
|
36
|
@ManyToMany(fetch = FetchType.LAZY, mappedBy = "comments")
|
37
|
private List<Budget> budgets = new ArrayList<>();
|
38
|
|
39
|
@ManyToMany(fetch = FetchType.LAZY, mappedBy = "requestComments")
|
40
|
@JsonBackReference
|
41
|
private List<Request> requests = new ArrayList<>();
|
42
|
|
43
|
public Comment() {
|
44
|
}
|
45
|
|
46
|
public Comment(User user, Timestamp date, String comment, CommentTemplate commentTemplate){
|
47
|
this.user = user;
|
48
|
this.date = date;
|
49
|
this.comment = comment;
|
50
|
this.template = commentTemplate;
|
51
|
}
|
52
|
|
53
|
public String getComment() {
|
54
|
return this.comment;
|
55
|
}
|
56
|
|
57
|
public void setComment(String comment) {
|
58
|
this.comment = comment;
|
59
|
}
|
60
|
|
61
|
public Timestamp getDate() {
|
62
|
return this.date;
|
63
|
}
|
64
|
|
65
|
public void setDate(Timestamp date) {
|
66
|
this.date = date;
|
67
|
}
|
68
|
|
69
|
public String getId() {
|
70
|
return this.id;
|
71
|
}
|
72
|
|
73
|
public void setId(String id) {
|
74
|
this.id = id;
|
75
|
}
|
76
|
|
77
|
public User getUser() {
|
78
|
return this.user;
|
79
|
}
|
80
|
|
81
|
public void setPerson(User user) {
|
82
|
this.user = user;
|
83
|
}
|
84
|
|
85
|
public CommentTemplate getTemplate() {
|
86
|
return this.template;
|
87
|
}
|
88
|
|
89
|
public void setTemplate(CommentTemplate template) {
|
90
|
this.template = template;
|
91
|
}
|
92
|
|
93
|
}
|