1
|
package eu.dnetlib.goldoa.domain;
|
2
|
|
3
|
import com.fasterxml.jackson.annotation.JsonBackReference;
|
4
|
|
5
|
import java.io.Serializable;
|
6
|
import java.util.ArrayList;
|
7
|
import java.util.List;
|
8
|
|
9
|
import javax.persistence.*;
|
10
|
|
11
|
@Entity
|
12
|
@Table(name="Publisher")
|
13
|
public class Publisher implements Serializable {
|
14
|
private static final long serialVersionUID = 1L;
|
15
|
|
16
|
@Id
|
17
|
@Column(columnDefinition = "text")
|
18
|
private String id;
|
19
|
@Column(columnDefinition = "float default 0")
|
20
|
private float apc;
|
21
|
@Column(columnDefinition = "float default 0")
|
22
|
private double discount;
|
23
|
@Column(columnDefinition = "text")
|
24
|
private String email;
|
25
|
@Column(columnDefinition = "text")
|
26
|
private String name;
|
27
|
@Column(columnDefinition = "text")
|
28
|
private String source;
|
29
|
|
30
|
@Basic
|
31
|
@Convert( converter=CurrencyConverter.class )
|
32
|
private Currency apcCurrency;
|
33
|
|
34
|
@OneToOne(cascade = CascadeType.ALL)
|
35
|
@JoinColumn(name = "bankAccount")
|
36
|
private BankAccount bankAccount;
|
37
|
|
38
|
@OneToMany(mappedBy = "pk.publisher", cascade=CascadeType.ALL,fetch = FetchType.LAZY)
|
39
|
@JsonBackReference
|
40
|
private List<PublisherDiscount> publisherDiscount = new ArrayList<>();
|
41
|
|
42
|
@OneToMany( mappedBy = "publisher")
|
43
|
@JsonBackReference(value = "contact")
|
44
|
private List<User> contacts = new ArrayList<>();
|
45
|
|
46
|
@ManyToMany(fetch = FetchType.LAZY, mappedBy = "publishers")
|
47
|
@JsonBackReference(value = "budgets")
|
48
|
private List<Budget> budgets = new ArrayList<>();
|
49
|
|
50
|
public Publisher() {}
|
51
|
|
52
|
public float getApc() {
|
53
|
return this.apc;
|
54
|
}
|
55
|
|
56
|
public void setApc(float apc) {
|
57
|
this.apc = apc;
|
58
|
}
|
59
|
|
60
|
public Currency getApcCurrency() {
|
61
|
return this.apcCurrency;
|
62
|
}
|
63
|
|
64
|
public void setApcCurrency(Currency apcCurrency) {
|
65
|
this.apcCurrency = apcCurrency;
|
66
|
}
|
67
|
|
68
|
|
69
|
|
70
|
public double getDiscount() {
|
71
|
return this.discount;
|
72
|
}
|
73
|
|
74
|
public void setDiscount(double discount) {
|
75
|
this.discount = discount;
|
76
|
}
|
77
|
|
78
|
public String getEmail() {
|
79
|
return this.email;
|
80
|
}
|
81
|
|
82
|
public void setEmail(String email) {
|
83
|
this.email = email;
|
84
|
}
|
85
|
|
86
|
public String getId() {
|
87
|
return this.id;
|
88
|
}
|
89
|
|
90
|
public void setId(String id) {
|
91
|
this.id = id;
|
92
|
}
|
93
|
|
94
|
public String getName() {
|
95
|
return this.name;
|
96
|
}
|
97
|
|
98
|
public void setName(String name) {
|
99
|
this.name = name;
|
100
|
}
|
101
|
|
102
|
public String getSource() {
|
103
|
return this.source;
|
104
|
}
|
105
|
|
106
|
public void setSource(String source) {
|
107
|
this.source = source;
|
108
|
}
|
109
|
|
110
|
public BankAccount getBankAccount() {
|
111
|
return bankAccount;
|
112
|
}
|
113
|
|
114
|
public void setBankAccount(BankAccount bankAccount) {
|
115
|
this.bankAccount = bankAccount;
|
116
|
}
|
117
|
|
118
|
public List<PublisherDiscount> getPublisherDiscount() {
|
119
|
return publisherDiscount;
|
120
|
}
|
121
|
|
122
|
public void setPublisherDiscount(List<PublisherDiscount> publisherDiscount) {
|
123
|
this.publisherDiscount = publisherDiscount;
|
124
|
}
|
125
|
|
126
|
public List<Budget> getBudgets() {
|
127
|
return budgets;
|
128
|
}
|
129
|
|
130
|
public void setBudgets(List<Budget> budgets) {
|
131
|
this.budgets = budgets;
|
132
|
}
|
133
|
|
134
|
public List<User> getContacts() {
|
135
|
return contacts;
|
136
|
}
|
137
|
|
138
|
}
|