This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
LocalUser.java
76 lines (61 loc) · 1.57 KB
/
LocalUser.java
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
package org.springframework.social.quickstart.model;
import java.util.HashSet;
import java.util.Set;
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.Table;
/*
* @author Marc Schipperheyn marc@orangebits.nl
*/
@Entity
@Table(name = "User")
public class LocalUser {
private Long id;
private String email,nickName,password;
private Set<SocialUser> socialUsers;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name="userId", nullable=true, insertable=false, updatable=false)
public Long getId() {
return id;
}
public void setId(Long userId) {
this.id = userId;
}
@Column(length=55)
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Column(length=55)
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
@Column(length=55)
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@OneToMany(cascade={CascadeType.ALL},mappedBy="user",fetch=FetchType.LAZY)
public Set<SocialUser> getSocialUsers() {
if(socialUsers == null)
socialUsers = new HashSet<SocialUser>();
return socialUsers;
}
public void setSocialUsers(Set<SocialUser> socialUsers) {
this.socialUsers = socialUsers;
}
}