root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 1 | package object; |
| 2 | |
root | 927f153 | 2025-05-09 05:33:32 +0000 | [diff] [blame^] | 3 | import javax.persistence.*; |
| 4 | |
| 5 | @Entity |
| 6 | @Table(name = "User", uniqueConstraints = @UniqueConstraint(name = "uniq_email", columnNames = {"email"})) |
| 7 | @IdClass(UserId.class) |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 8 | public class User { |
root | 927f153 | 2025-05-09 05:33:32 +0000 | [diff] [blame^] | 9 | @Id |
| 10 | @Column(name = "user_id", length = 36, nullable = false) |
root | 4b6a76b | 2025-05-09 04:57:59 +0000 | [diff] [blame] | 11 | public String userid; |
root | 927f153 | 2025-05-09 05:33:32 +0000 | [diff] [blame^] | 12 | |
| 13 | @Column(name = "username", length = 100, nullable = false) |
root | 4b6a76b | 2025-05-09 04:57:59 +0000 | [diff] [blame] | 14 | public String username; |
root | 927f153 | 2025-05-09 05:33:32 +0000 | [diff] [blame^] | 15 | |
| 16 | @Column(name = "password", length = 255, nullable = false) |
root | 4b6a76b | 2025-05-09 04:57:59 +0000 | [diff] [blame] | 17 | public String password; |
root | 927f153 | 2025-05-09 05:33:32 +0000 | [diff] [blame^] | 18 | |
| 19 | @Column(name = "gender", nullable = false) |
root | 4b6a76b | 2025-05-09 04:57:59 +0000 | [diff] [blame] | 20 | public String sex; |
root | 927f153 | 2025-05-09 05:33:32 +0000 | [diff] [blame^] | 21 | |
| 22 | @Transient |
root | 4b6a76b | 2025-05-09 04:57:59 +0000 | [diff] [blame] | 23 | public String age; |
root | 927f153 | 2025-05-09 05:33:32 +0000 | [diff] [blame^] | 24 | |
| 25 | @Id |
| 26 | @Column(name = "email", length = 255, nullable = false) |
root | 4b6a76b | 2025-05-09 04:57:59 +0000 | [diff] [blame] | 27 | public String email; |
root | 927f153 | 2025-05-09 05:33:32 +0000 | [diff] [blame^] | 28 | |
| 29 | @Column(name = "school") |
root | 4b6a76b | 2025-05-09 04:57:59 +0000 | [diff] [blame] | 30 | public String school; |
root | 927f153 | 2025-05-09 05:33:32 +0000 | [diff] [blame^] | 31 | |
| 32 | @Column(name = "avatar_url") |
root | 4b6a76b | 2025-05-09 04:57:59 +0000 | [diff] [blame] | 33 | public String pictureurl; |
root | 927f153 | 2025-05-09 05:33:32 +0000 | [diff] [blame^] | 34 | |
| 35 | @Column(name = "bio") |
root | 4b6a76b | 2025-05-09 04:57:59 +0000 | [diff] [blame] | 36 | public String profile; |
root | 927f153 | 2025-05-09 05:33:32 +0000 | [diff] [blame^] | 37 | |
| 38 | @Column(name = "account_status", nullable = false) |
root | 4b6a76b | 2025-05-09 04:57:59 +0000 | [diff] [blame] | 39 | public boolean accountstate; |
root | 927f153 | 2025-05-09 05:33:32 +0000 | [diff] [blame^] | 40 | |
| 41 | @Column(name = "invite_left", nullable = false) |
root | 4b6a76b | 2025-05-09 04:57:59 +0000 | [diff] [blame] | 42 | public int invitetimes; |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 43 | } |