1
|
package eu.dnetlib.goldoa.domain;
|
2
|
|
3
|
import com.fasterxml.jackson.annotation.JsonBackReference;
|
4
|
import com.google.gwt.user.client.rpc.IsSerializable;
|
5
|
import org.hibernate.annotations.Cache;
|
6
|
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
7
|
|
8
|
import javax.persistence.*;
|
9
|
import java.util.ArrayList;
|
10
|
import java.util.List;
|
11
|
|
12
|
|
13
|
@Entity
|
14
|
@Cache(usage= CacheConcurrencyStrategy.READ_ONLY,region = "user")
|
15
|
public class Organization implements IsSerializable {
|
16
|
private static final long serialVersionUID = 1L;
|
17
|
|
18
|
@Id
|
19
|
@Column(columnDefinition = "text")
|
20
|
private String id;
|
21
|
@Column(columnDefinition = "text")
|
22
|
private String name;
|
23
|
@Column(columnDefinition = "text")
|
24
|
private String shortname;
|
25
|
@Column(columnDefinition = "text")
|
26
|
private String source;
|
27
|
|
28
|
@OneToOne
|
29
|
@JoinColumn(name = "country")
|
30
|
private Country country;
|
31
|
|
32
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "pk.organization")
|
33
|
private List<JournalDiscount> journalDiscounts = new ArrayList<>();
|
34
|
|
35
|
|
36
|
@ManyToMany(fetch = FetchType.LAZY,mappedBy = "organizations")
|
37
|
@JsonBackReference(value = "organization_budget")
|
38
|
private List<Budget> budgets = new ArrayList<>();
|
39
|
|
40
|
@ManyToMany(fetch = FetchType.LAZY, mappedBy = "organizations")
|
41
|
@JsonBackReference(value = "projects")
|
42
|
private List<Project> projects = new ArrayList<>();
|
43
|
|
44
|
|
45
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "pk.organization")
|
46
|
@JsonBackReference(value = "publisherDiscount")
|
47
|
private List<PublisherDiscount> publisherDiscount = new ArrayList<>();
|
48
|
|
49
|
public Organization() {}
|
50
|
|
51
|
public String getId() {
|
52
|
return this.id;
|
53
|
}
|
54
|
|
55
|
public void setId(String id) {
|
56
|
this.id = id;
|
57
|
}
|
58
|
|
59
|
public Country getCountry() {
|
60
|
return this.country;
|
61
|
}
|
62
|
|
63
|
public void setCountry(Country country) {
|
64
|
this.country = country;
|
65
|
}
|
66
|
|
67
|
public String getName() {
|
68
|
return this.name;
|
69
|
}
|
70
|
|
71
|
public void setName(String name) {
|
72
|
this.name = name;
|
73
|
}
|
74
|
|
75
|
public String getShortname() {
|
76
|
return this.shortname;
|
77
|
}
|
78
|
|
79
|
public void setShortname(String shortname) {
|
80
|
this.shortname = shortname;
|
81
|
}
|
82
|
|
83
|
public String getSource() {
|
84
|
return this.source;
|
85
|
}
|
86
|
|
87
|
public void setSource(String source) {
|
88
|
this.source = source;
|
89
|
}
|
90
|
|
91
|
public List<Budget> getBudgets() {
|
92
|
return budgets;
|
93
|
}
|
94
|
|
95
|
public void setBudgets(List<Budget> budgets) {
|
96
|
this.budgets = budgets;
|
97
|
}
|
98
|
|
99
|
public List<Project> getProjects() {
|
100
|
return projects;
|
101
|
}
|
102
|
|
103
|
public void setProjects(List<Project> projects) {
|
104
|
this.projects = projects;
|
105
|
}
|
106
|
|
107
|
}
|