content: package io.aharoj.barbershop_backend.modules.auth.model.entity;
  
  import java.time.Instant;
  
  import jakarta.persistence.*;
  
  @Entity
  @Table(name = "refresh_tokens")
  public class RefreshToken {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;
  
    @Column(nullable = false, unique = true)
    private String token;
  
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id", nullable = false)
    private User user;
  
    private Instant expiryDate;
  
    public RefreshToken() {
    }
  
    public RefreshToken(String token, User user, Instant expiryDate) {
      this.token = token;
      this.user = user;
      this.expiryDate = expiryDate;
    }
  
    public long getId() {
      return id;
    }
  
    public void setId(long id) {
      this.id = id;
    }
  
    public String getToken() {
      return token;
    }
  
    public void setToken(String token) {
      this.token = token;
    }
  
    public User getUser() {
      return user;
    }
  
    public void setUser(User user) {
      this.user = user;
    }
  
    public Instant getExpiryDate() {
      return expiryDate;
    }
  
    public void setExpiryDate(Instant expiryDate) {
      this.expiryDate = expiryDate;
    }
  
  }
  