-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
42 lines (32 loc) · 966 Bytes
/
User.java
File metadata and controls
42 lines (32 loc) · 966 Bytes
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
package com.example.enjoy.entity.user;
import com.example.enjoy.entity.BaseTimeEntity;
import jakarta.persistence.*;
import lombok.*;
@Builder
@Entity
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class User extends BaseTimeEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String studentId;
@Column(nullable = false, unique = true)
private String username;
@Column(nullable = false)
private String major;
@Column(nullable = false)
private String grade;
@Column(nullable = false)
private String completedSemester;
public void updateUserInfo(String studentId, String username, String major, String grade, String completedSemester) {
this.studentId = studentId;
this.username = username;
this.major = major;
this.grade = grade;
this.completedSemester = completedSemester;
}
}