blob: f73c868042cc51228fd4b8fcc840b1f0efe9a69e [file] [log] [blame]
rootff0769a2025-05-18 17:24:41 +00001package entity;
2
Raver27caad72025-06-03 06:02:49 +00003import java.util.Date;
4
rootff0769a2025-05-18 17:24:41 +00005import javax.persistence.CascadeType;
6import javax.persistence.Column;
7import javax.persistence.Entity;
8import javax.persistence.FetchType;
9import javax.persistence.Id;
10import javax.persistence.OneToOne;
11import javax.persistence.Table;
Raver5ba779f2025-05-14 12:48:12 +000012import javax.persistence.Temporal;
13import javax.persistence.TemporalType;
rootff0769a2025-05-18 17:24:41 +000014import javax.persistence.Transient;
Raver27caad72025-06-03 06:02:49 +000015
rootff0769a2025-05-18 17:24:41 +000016import com.querydsl.core.annotations.QueryEntity;
17
18@QueryEntity
root33a7d952025-05-18 17:24:41 +000019@Entity(name = "User")
rootff0769a2025-05-18 17:24:41 +000020@Table(name = "User")
21public class User {
22 @Id
23 @Column(name = "user_id", length = 36, nullable = false)
rootf35409f2025-05-19 04:41:57 +000024 public String userid;
rootff0769a2025-05-18 17:24:41 +000025 @Column(name = "email", nullable = false, length = 255, unique = true)
rootf35409f2025-05-19 04:41:57 +000026 public String email;
rootff0769a2025-05-18 17:24:41 +000027 @Column(name = "username", length = 100, nullable = false)
28 public String username;
rootff0769a2025-05-18 17:24:41 +000029 @Column(name = "password", length = 255, nullable = false)
30 public String password;
rootff0769a2025-05-18 17:24:41 +000031 @Column(name = "gender", nullable = false)
32 public String sex;
Raver5ba779f2025-05-14 12:48:12 +000033
34 @Column(name = "detectedCount", nullable = false)
35 public int detectedCount = 0;
36
37 @Temporal(TemporalType.TIMESTAMP)
95630366937300532025-06-02 14:43:06 +080038 @Column(name = "lastDetectedTime", nullable = false)
Raver5ba779f2025-05-14 12:48:12 +000039 public Date lastDetectedTime = new Date();
40
41 @Column(name = "fake_detected_count", nullable = false)
42 public int fakeDetectedCount = 0;
43
44 @Temporal(TemporalType.TIMESTAMP)
45 @Column(name = "fake_last_detected_time", nullable = false)
46 public Date fakeLastDetectedTime = new Date();
47
rootff0769a2025-05-18 17:24:41 +000048 @Transient
49 public String age;
rootff0769a2025-05-18 17:24:41 +000050 @Column(name = "school")
51 public String school;
rootff0769a2025-05-18 17:24:41 +000052 @Column(name = "avatar_url")
53 public String pictureurl;
rootff0769a2025-05-18 17:24:41 +000054 @Column(name = "bio")
55 public String profile;
rootff0769a2025-05-18 17:24:41 +000056 @Column(name = "account_status", nullable = false)
57 public boolean accountstate;
rootff0769a2025-05-18 17:24:41 +000058 @Column(name = "invite_left", nullable = false)
59 public int invitetimes;
rootff0769a2025-05-18 17:24:41 +000060 @OneToOne(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY, optional = false)
61 public UserPT userPT;
62
63 // Constructors, getters, setters
root33a7d952025-05-18 17:24:41 +000064 public User() {
65 }
66}