[74af394] | 1 | package com.example.salonbella.entity;
|
---|
| 2 |
|
---|
| 3 | import javax.persistence.*;
|
---|
| 4 | import java.time.LocalDateTime;
|
---|
| 5 |
|
---|
| 6 | @Entity
|
---|
| 7 | @Table(name = "confirmation_token")
|
---|
| 8 | public class ConfirmationTokenEntity {
|
---|
| 9 |
|
---|
| 10 | @Id
|
---|
| 11 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
| 12 | private Long id;
|
---|
| 13 |
|
---|
| 14 | @Column(name = "token",nullable = false)
|
---|
| 15 | private String token;
|
---|
| 16 |
|
---|
| 17 | @Column(name = "created",nullable = false)
|
---|
| 18 | private LocalDateTime createdAt;
|
---|
| 19 |
|
---|
| 20 | @Column(name = "expires",nullable = false)
|
---|
| 21 | private LocalDateTime expiresAt;
|
---|
| 22 |
|
---|
| 23 | private LocalDateTime confirmedAt;
|
---|
| 24 |
|
---|
| 25 | @ManyToOne
|
---|
| 26 | @JoinColumn(name = "user_id",nullable = false)
|
---|
| 27 | private UserEntity user;
|
---|
| 28 |
|
---|
| 29 | public ConfirmationTokenEntity() {
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | public ConfirmationTokenEntity(String token, LocalDateTime createdAt, LocalDateTime expiresAt, UserEntity user) {
|
---|
| 33 | this.token = token;
|
---|
| 34 | this.createdAt = createdAt;
|
---|
| 35 | this.expiresAt = expiresAt;
|
---|
| 36 | this.user = user;
|
---|
| 37 | }
|
---|
| 38 |
|
---|
| 39 | public Long getId() {
|
---|
| 40 | return id;
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | public void setId(Long id) {
|
---|
| 44 | this.id = id;
|
---|
| 45 | }
|
---|
| 46 |
|
---|
| 47 | public String getToken() {
|
---|
| 48 | return token;
|
---|
| 49 | }
|
---|
| 50 |
|
---|
| 51 | public void setToken(String token) {
|
---|
| 52 | this.token = token;
|
---|
| 53 | }
|
---|
| 54 |
|
---|
| 55 | public LocalDateTime getCreatedAt() {
|
---|
| 56 | return createdAt;
|
---|
| 57 | }
|
---|
| 58 |
|
---|
| 59 | public void setCreatedAt(LocalDateTime createdAt) {
|
---|
| 60 | this.createdAt = createdAt;
|
---|
| 61 | }
|
---|
| 62 |
|
---|
| 63 | public LocalDateTime getExpiresAt() {
|
---|
| 64 | return expiresAt;
|
---|
| 65 | }
|
---|
| 66 |
|
---|
| 67 | public void setExpiresAt(LocalDateTime expiresAt) {
|
---|
| 68 | this.expiresAt = expiresAt;
|
---|
| 69 | }
|
---|
| 70 |
|
---|
| 71 | public LocalDateTime getConfirmedAt() {
|
---|
| 72 | return confirmedAt;
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 | public void setConfirmedAt(LocalDateTime confirmedAt) {
|
---|
| 76 | this.confirmedAt = confirmedAt;
|
---|
| 77 | }
|
---|
| 78 |
|
---|
| 79 | public UserEntity getUser() {
|
---|
| 80 | return user;
|
---|
| 81 | }
|
---|
| 82 |
|
---|
| 83 | public void setUser(UserEntity user) {
|
---|
| 84 | this.user = user;
|
---|
| 85 | }
|
---|
| 86 | }
|
---|