1
0
forked from PGL/Clyde

added foreign key to user

This commit is contained in:
Bartha Maxime 2024-03-06 17:37:06 +01:00
parent b050a74b75
commit 5acca4d10d

View File

@ -8,12 +8,13 @@ public class Token {
@Id
private int id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name ="Users")
private int regNo;
private User user;
private String token;
public Token(int regNo, String token){
this.regNo = regNo;
public Token(User user, String token){
this.user = user;
this.token = token;
}
@ -21,13 +22,12 @@ public class Token {
public int getId() {
return id;
}
public int getRegNo() {
return regNo;
public User getUser() {
return user;
}
public void setRegNo(int regNo) {
this.regNo = regNo;
public void setUser(User regNo) {
this.user = regNo;
}
public String getToken(){