source: sources/app/src/main/java/parkup/configs/token/ConfirmationTokenW.java@ 97fbc67

Last change on this file since 97fbc67 was 97fbc67, checked in by andrejTavchioski <andrej.tavchioski@…>, 3 years ago

fixed deleteVraboten and deleteRegistriranParkirac

  • Property mode set to 100644
File size: 2.6 KB
Line 
1package parkup.configs.token;
2
3import parkup.entities.Vraboten;
4
5import javax.persistence.*;
6import java.time.LocalDateTime;
7
8@Entity
9public class ConfirmationTokenW {
10
11 @Id
12 @Column(name = "confirmation_token_id")
13 @SequenceGenerator(
14 name="confirmation_token_sequence_generator_W",
15 sequenceName = "confirmation_token_sequence_W",
16 allocationSize = 1,
17 initialValue = 1200
18 )
19 @GeneratedValue( //za postgres treba sequence da se namesti i ime na generator mi ga davamo kako od gore sto e
20 strategy = GenerationType.SEQUENCE,
21 generator = "confirmation_token_sequence_generator_W"
22 )
23 private int id;
24
25 @Column(nullable = false)
26 private String token;
27
28 @Column(nullable = false)
29 private LocalDateTime createdAt;
30
31 @Column(nullable = false)
32 private LocalDateTime expiresAt;
33
34 private LocalDateTime confirmedAt;
35
36 @ManyToOne(cascade = {CascadeType.ALL})
37 @JoinColumn(nullable = false, name = "vraboten_id")
38 //many confirmation tokens to one registriranParkirac
39 private Vraboten vraboten;
40
41 public ConfirmationTokenW() {}
42
43 public ConfirmationTokenW(int id, String token, LocalDateTime createdAt, LocalDateTime expiresAt, Vraboten vraboten) {
44 this.id = id;
45 this.token = token;
46 this.createdAt = createdAt;
47 this.expiresAt = expiresAt;
48 this.vraboten = vraboten;
49 }
50
51 public ConfirmationTokenW(String token, LocalDateTime createdAt, LocalDateTime expiresAt, Vraboten vraboten) {
52 this.token = token;
53 this.createdAt = createdAt;
54 this.expiresAt = expiresAt;
55 this.vraboten = vraboten;
56 }
57
58 public int getId() {
59 return id;
60 }
61
62 public void setId(int id) {
63 this.id = id;
64 }
65
66 public String getToken() {
67 return token;
68 }
69
70 public void setToken(String token) {
71 this.token = token;
72 }
73
74 public LocalDateTime getCreatedAt() {
75 return createdAt;
76 }
77
78 public void setCreatedAt(LocalDateTime createdAt) {
79 this.createdAt = createdAt;
80 }
81
82 public LocalDateTime getExpiresAt() {
83 return expiresAt;
84 }
85
86 public void setExpiresAt(LocalDateTime expiresAt) {
87 this.expiresAt = expiresAt;
88 }
89
90 public LocalDateTime getConfirmedAt() {
91 return confirmedAt;
92 }
93
94 public void setConfirmedAt(LocalDateTime confirmedAt) {
95 this.confirmedAt = confirmedAt;
96 }
97
98 public Vraboten getRegistriranParkirac() {
99 return vraboten;
100 }
101
102 public void setRegistriranParkirac(Vraboten vraboten) {
103 this.vraboten = vraboten;
104 }
105}
Note: See TracBrowser for help on using the repository browser.