32 lines
728 B
Java
32 lines
728 B
Java
package ru.soune.nocopy.entity.user;
|
|||
|
|
|
||
|
|
import jakarta.persistence.*;
|
||
|
|
import lombok.*;
|
||
|
|
import java.time.LocalDateTime;
|
||
|
|
|
||
|
|
@Entity
|
||
|
|
@Table(name = "email_verification_tokens")
|
||
|
|
@Getter
|
||
|
|
@Setter
|
||
|
|
@NoArgsConstructor
|
||
|
|
@AllArgsConstructor
|
||
|
|
public class EmailVerificationToken {
|
||
|
|
|
||
|
|
@Id
|
||
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||
|
|
private Long id;
|
||
|
|
|
||
|
|
@ManyToOne(fetch = FetchType.LAZY)
|
||
|
|
@JoinColumn(name = "user_id", nullable = false)
|
||
|
|
private User user;
|
||
|
|
|
||
|
|
@Column(name = "token", nullable = false, length = 6)
|
||
|
|
private String token;
|
||
|
|
|
||
|
|
@Column(name = "expires_at", nullable = false)
|
||
|
|
private LocalDateTime expiresAt;
|
||
|
|
|
||
|
|
@Column(name = "created_at", nullable = false)
|
||
|
|
private LocalDateTime createdAt;
|
||
|
|
}
|