blob: 69d34eda9b18fb7bd0e55e9b41018995b8153fad [file] [log] [blame]
rootff0769a2025-05-18 17:24:41 +00001package entity;
2
3import javax.persistence.CascadeType;
4import javax.persistence.Column;
5import javax.persistence.Entity;
6import javax.persistence.FetchType;
7import javax.persistence.Id;
8import javax.persistence.OneToOne;
9import javax.persistence.Table;
10import javax.persistence.Transient;
11
12import com.querydsl.core.annotations.QueryEntity;
13
14@QueryEntity
15@Entity(name="User")
16@Table(name = "User")
17public class User {
18 @Id
19 @Column(name = "user_id", length = 36, nullable = false)
rootf35409f2025-05-19 04:41:57 +000020 public String userid;
rootff0769a2025-05-18 17:24:41 +000021
22 @Column(name = "email", nullable = false, length = 255, unique = true)
rootf35409f2025-05-19 04:41:57 +000023 public String email;
rootff0769a2025-05-18 17:24:41 +000024
25 @Column(name = "username", length = 100, nullable = false)
26 public String username;
27
28 @Column(name = "password", length = 255, nullable = false)
29 public String password;
30
31 @Column(name = "gender", nullable = false)
32 public String sex;
33
34 @Transient
35 public String age;
36
37 @Column(name = "school")
38 public String school;
39
40 @Column(name = "avatar_url")
41 public String pictureurl;
42
43 @Column(name = "bio")
44 public String profile;
45
46 @Column(name = "account_status", nullable = false)
47 public boolean accountstate;
48
49 @Column(name = "invite_left", nullable = false)
50 public int invitetimes;
51
52 @OneToOne(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY, optional = false)
53 public UserPT userPT;
54
55 // Constructors, getters, setters
56 public User() {}
57}