-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUser.java
More file actions
67 lines (45 loc) · 1.47 KB
/
User.java
File metadata and controls
67 lines (45 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package com.example.be.domain;
import com.example.be.domain.enums.LoginType;
import jakarta.persistence.*;
import lombok.*;
import org.springframework.cglib.core.Local;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.UUID;
@Entity
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String name;
private UUID userId;
@Column(nullable = false, unique = true)
private String email;
private String password;
private String provider;
private String providerId;
private LocalDateTime createDate;
private String resolve;
@Column(columnDefinition = "int default 0")
private int todayStudyTime;
@Column(columnDefinition = "int default 0")
private int totalStudyTime;
@Column(columnDefinition = "int default 0")
private int goalStudyTime;
//Relationships
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Comment> comments;
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Post> posts;
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true)
private List<DDay> dDays;
@OneToOne(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true)
private Participant participant;
}