forked from DSpace/DSpace
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathClarinUserRegistration.java
More file actions
137 lines (106 loc) · 3.98 KB
/
ClarinUserRegistration.java
File metadata and controls
137 lines (106 loc) · 3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.content.clarin;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.apache.logging.log4j.Logger;
import org.dspace.core.ReloadableEntity;
@Entity
@Table(name = "user_registration")
public class ClarinUserRegistration implements ReloadableEntity<Integer> {
// Anonymous user
public static final String ANONYMOUS_USER_REGISTRATION = "anonymous";
// Registered user without organization
public static final String UNKNOWN_USER_REGISTRATION = "Unknown";
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(ClarinUserRegistration.class);
@Id
@Column(name = "user_registration_id")
@GeneratedValue(strategy = GenerationType.SEQUENCE,
generator = "user_registration_user_registration_id_seq")
@SequenceGenerator(name = "user_registration_user_registration_id_seq",
sequenceName = "user_registration_user_registration_id_seq",
allocationSize = 1)
protected Integer id;
@Column(name = "eperson_id")
private UUID ePersonID = null;
@Column(name = "email")
private String email = null;
@Column(name = "organization")
private String organization = null;
@Column(name = "confirmation")
private boolean confirmation = false;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "eperson", cascade = CascadeType.PERSIST)
private List<ClarinLicense> clarinLicenses = new ArrayList<>();
@OneToMany(fetch = FetchType.LAZY, mappedBy = "userRegistration", cascade = CascadeType.PERSIST)
private List<ClarinLicenseResourceUserAllowance> licenseResourceUserAllowances = new ArrayList<>();
@OneToMany(fetch = FetchType.LAZY, mappedBy = "eperson", cascade = CascadeType.PERSIST)
private List<ClarinUserMetadata> userMetadata = new ArrayList<>();
public ClarinUserRegistration() {
}
public UUID getPersonID() {
return ePersonID;
}
public void setPersonID(UUID ePersonID) {
this.ePersonID = ePersonID;
}
public void setId(Integer id) {
this.id = id;
}
@Override
public Integer getID() {
return id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getOrganization() {
return organization;
}
public void setOrganization(String organization) {
this.organization = organization;
}
public boolean isConfirmation() {
return confirmation;
}
public void setConfirmation(boolean confirmation) {
this.confirmation = confirmation;
}
public List<ClarinLicense> getClarinLicenses() {
return clarinLicenses;
}
public List<ClarinLicenseResourceUserAllowance> getLicenseResourceUserAllowances() {
return licenseResourceUserAllowances;
}
public void setClarinLicenses(List<ClarinLicense> clarinLicenses) {
this.clarinLicenses = clarinLicenses;
}
public void setLicenseResourceUserAllowances(List<ClarinLicenseResourceUserAllowance>
licenseResourceUserAllowances) {
this.licenseResourceUserAllowances = licenseResourceUserAllowances;
}
public List<ClarinUserMetadata> getUserMetadata() {
return userMetadata;
}
public void setUserMetadata(List<ClarinUserMetadata> userMetadata) {
this.userMetadata = userMetadata;
}
}