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