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