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
|
|
11
|
@Entity
|
12
|
@Table(name = "author")
|
13
|
public class Author implements IsSerializable{
|
14
|
private static final long serialVersionUID = 1L;
|
15
|
|
16
|
@Id
|
17
|
@Column(columnDefinition = "text")
|
18
|
private String id;
|
19
|
|
20
|
@Column(columnDefinition = "text",nullable=false)
|
21
|
private String firstname;
|
22
|
|
23
|
@Column(columnDefinition = "text",nullable=false)
|
24
|
private String lastname;
|
25
|
|
26
|
@Column(columnDefinition = "text")
|
27
|
private String initials;
|
28
|
|
29
|
@Column(columnDefinition = "text")
|
30
|
private String email;
|
31
|
|
32
|
@Column(columnDefinition = "text")
|
33
|
private String department;
|
34
|
|
35
|
@OneToOne
|
36
|
@JoinColumn(name="organization")
|
37
|
private Organization organization;
|
38
|
|
39
|
@ManyToMany(fetch = FetchType.LAZY, mappedBy = "authors")
|
40
|
@JsonBackReference(value = "publications")
|
41
|
private List<Publication> publications = new ArrayList<>();
|
42
|
|
43
|
public Author() {}
|
44
|
|
45
|
public String getFirstname() {
|
46
|
return firstname;
|
47
|
}
|
48
|
|
49
|
public void setFirstname(String firstname) {
|
50
|
this.firstname = firstname;
|
51
|
}
|
52
|
|
53
|
public String getLastname() {
|
54
|
return lastname;
|
55
|
}
|
56
|
|
57
|
public void setLastname(String lastname) {
|
58
|
this.lastname = lastname;
|
59
|
}
|
60
|
|
61
|
public String getInitials() {
|
62
|
return initials;
|
63
|
}
|
64
|
|
65
|
public void setInitials(String initials) {
|
66
|
this.initials = initials;
|
67
|
}
|
68
|
|
69
|
public String getEmail() {
|
70
|
return email;
|
71
|
}
|
72
|
|
73
|
public void setEmail(String email) {
|
74
|
this.email = email;
|
75
|
}
|
76
|
|
77
|
public String getDepartment() {
|
78
|
return department;
|
79
|
}
|
80
|
|
81
|
public void setDepartment(String department) {
|
82
|
this.department = department;
|
83
|
}
|
84
|
|
85
|
public String getId() {
|
86
|
return id;
|
87
|
}
|
88
|
|
89
|
public void setId(String id) {
|
90
|
this.id = id;
|
91
|
}
|
92
|
|
93
|
public List<Publication> getPublications() {
|
94
|
return publications;
|
95
|
}
|
96
|
|
97
|
public void setPublications(List<Publication> publications) {
|
98
|
this.publications = publications;
|
99
|
}
|
100
|
|
101
|
public Organization getOrganization() {
|
102
|
return organization;
|
103
|
}
|
104
|
|
105
|
public void setOrganization(Organization organization) {
|
106
|
this.organization = organization;
|
107
|
}
|
108
|
}
|