Project

General

Profile

1
package eu.dnetlib.goldoa.domain;
2

    
3
import com.fasterxml.jackson.annotation.JsonBackReference;
4
import org.hibernate.annotations.*;
5
import org.hibernate.annotations.Cache;
6

    
7
import java.io.Serializable;
8
import javax.persistence.*;
9
import javax.persistence.Entity;
10
import javax.persistence.Table;
11
import java.sql.Timestamp;
12
import java.util.ArrayList;
13
import java.util.List;
14

    
15

    
16
@Entity
17
@Table(name="Affiliation")
18
public class Affiliation implements Serializable {
19
	private static final long serialVersionUID = 1L;
20

    
21
	@Id
22
	@GeneratedValue(strategy=GenerationType.AUTO)
23
	private Integer id;
24

    
25
	@OneToOne
26
	@JoinColumn(name="organization")
27
	private Organization organization;
28
	@Column(columnDefinition = "text")
29
	private String department;
30
	private Timestamp enddate;
31
	private Timestamp startdate;
32

    
33
	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "affiliations")
34
	@JsonBackReference
35
	private List<User> users = new ArrayList<>();
36

    
37
	public Integer getId() {
38
		return id;
39
	}
40

    
41
	public void setId(Integer id) {
42
		this.id = id;
43
	}
44

    
45
	public Organization getOrganization() {
46
		return organization;
47
	}
48

    
49
	public void setOrganization(Organization organization) {
50
		this.organization = organization;
51
	}
52

    
53
	public String getDepartment() {
54
		return department;
55
	}
56

    
57
	public void setDepartment(String department) {
58
		this.department = department;
59
	}
60

    
61
	public Timestamp getEnddate() {
62
		return enddate;
63
	}
64

    
65
	public void setEnddate(Timestamp enddate) {
66
		this.enddate = enddate;
67
	}
68

    
69
	public Timestamp getStartdate() {
70
		return startdate;
71
	}
72

    
73
	public void setStartdate(Timestamp startdate) {
74
		this.startdate = startdate;
75
	}
76

    
77
	public List<User> getUsers() {
78
		return users;
79
	}
80

    
81
	public void setUsers(List<User> users) {
82
		this.users = users;
83
	}
84

    
85
}
(2-2/52)