package ovh.herisson.Clyde.Tables;

import jakarta.persistence.*;

import java.util.Date;

@Entity
public class Token {
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Id
    private int id;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name ="Users")
    private User user;
    private String token;
    private Date expirationDate;

    public Token(User user, String token, Date expirationDate){
        this.user = user;
        this.token = token;
        this.expirationDate = expirationDate;
    }

    public Token(){}

    public int getId() {
        return id;
    }
    public User getUser() {
        return user;
    }

    public void setUser(User regNo) {
        this.user = regNo;
    }

    public String getToken(){
        return token;
    }

    public void setToken(String data) {
        this.token = data;
    }

    public void setExpirationDate(Date date){
        this.expirationDate = date;
    }

    public Date getExpirationDate(){
        return expirationDate;
    }
}
