root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 1 | package entity; |
| 2 | |
| 3 | import javax.persistence.CascadeType; |
| 4 | import javax.persistence.Column; |
| 5 | import javax.persistence.Entity; |
| 6 | import javax.persistence.FetchType; |
| 7 | import javax.persistence.Id; |
| 8 | import javax.persistence.OneToOne; |
| 9 | import javax.persistence.Table; |
Raver | 5ba779f | 2025-05-14 12:48:12 +0000 | [diff] [blame] | 10 | import java.util.Date; |
| 11 | import javax.persistence.Temporal; |
| 12 | import javax.persistence.TemporalType; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 13 | import javax.persistence.Transient; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 14 | import com.querydsl.core.annotations.QueryEntity; |
| 15 | |
| 16 | @QueryEntity |
root | 33a7d95 | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 17 | @Entity(name = "User") |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 18 | @Table(name = "User") |
| 19 | public class User { |
| 20 | @Id |
| 21 | @Column(name = "user_id", length = 36, nullable = false) |
root | f35409f | 2025-05-19 04:41:57 +0000 | [diff] [blame] | 22 | public String userid; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 23 | @Column(name = "email", nullable = false, length = 255, unique = true) |
root | f35409f | 2025-05-19 04:41:57 +0000 | [diff] [blame] | 24 | public String email; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 25 | @Column(name = "username", length = 100, nullable = false) |
| 26 | public String username; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 27 | @Column(name = "password", length = 255, nullable = false) |
| 28 | public String password; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 29 | @Column(name = "gender", nullable = false) |
| 30 | public String sex; |
Raver | 5ba779f | 2025-05-14 12:48:12 +0000 | [diff] [blame] | 31 | |
| 32 | @Column(name = "detectedCount", nullable = false) |
| 33 | public int detectedCount = 0; |
| 34 | |
| 35 | @Temporal(TemporalType.TIMESTAMP) |
956303669 | 3730053 | 2025-06-02 14:43:06 +0800 | [diff] [blame^] | 36 | @Column(name = "lastDetectedTime", nullable = false) |
Raver | 5ba779f | 2025-05-14 12:48:12 +0000 | [diff] [blame] | 37 | public Date lastDetectedTime = new Date(); |
| 38 | |
| 39 | @Column(name = "fake_detected_count", nullable = false) |
| 40 | public int fakeDetectedCount = 0; |
| 41 | |
| 42 | @Temporal(TemporalType.TIMESTAMP) |
| 43 | @Column(name = "fake_last_detected_time", nullable = false) |
| 44 | public Date fakeLastDetectedTime = new Date(); |
| 45 | |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 46 | @Transient |
| 47 | public String age; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 48 | @Column(name = "school") |
| 49 | public String school; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 50 | @Column(name = "avatar_url") |
| 51 | public String pictureurl; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 52 | @Column(name = "bio") |
| 53 | public String profile; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 54 | @Column(name = "account_status", nullable = false) |
| 55 | public boolean accountstate; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 56 | @Column(name = "invite_left", nullable = false) |
| 57 | public int invitetimes; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 58 | @OneToOne(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY, optional = false) |
| 59 | public UserPT userPT; |
| 60 | |
| 61 | // Constructors, getters, setters |
root | 33a7d95 | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 62 | public User() { |
| 63 | } |
| 64 | } |