blob: d1d67c72fcf9a2f72eba1abd549fc219b9aef9b8 [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;
rootff0769a2025-05-18 17:24:41 +000011import com.querydsl.core.annotations.QueryEntity;
12
13@QueryEntity
root33a7d952025-05-18 17:24:41 +000014@Entity(name = "User")
rootff0769a2025-05-18 17:24:41 +000015@Table(name = "User")
16public class User {
17 @Id
18 @Column(name = "user_id", length = 36, nullable = false)
rootf35409f2025-05-19 04:41:57 +000019 public String userid;
rootff0769a2025-05-18 17:24:41 +000020 @Column(name = "email", nullable = false, length = 255, unique = true)
rootf35409f2025-05-19 04:41:57 +000021 public String email;
rootff0769a2025-05-18 17:24:41 +000022 @Column(name = "username", length = 100, nullable = false)
23 public String username;
rootff0769a2025-05-18 17:24:41 +000024 @Column(name = "password", length = 255, nullable = false)
25 public String password;
rootff0769a2025-05-18 17:24:41 +000026 @Column(name = "gender", nullable = false)
27 public String sex;
rootff0769a2025-05-18 17:24:41 +000028 @Transient
29 public String age;
rootff0769a2025-05-18 17:24:41 +000030 @Column(name = "school")
31 public String school;
rootff0769a2025-05-18 17:24:41 +000032 @Column(name = "avatar_url")
33 public String pictureurl;
rootff0769a2025-05-18 17:24:41 +000034 @Column(name = "bio")
35 public String profile;
rootff0769a2025-05-18 17:24:41 +000036 @Column(name = "account_status", nullable = false)
37 public boolean accountstate;
rootff0769a2025-05-18 17:24:41 +000038 @Column(name = "invite_left", nullable = false)
39 public int invitetimes;
rootff0769a2025-05-18 17:24:41 +000040 @OneToOne(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY, optional = false)
41 public UserPT userPT;
42
43 // Constructors, getters, setters
root33a7d952025-05-18 17:24:41 +000044 public User() {
45 }
46}