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
RevLine 
[ce6ad22]1package parkup.configs.token;
2
[97fbc67]3import parkup.entities.Vraboten;
[ce6ad22]4
5import javax.persistence.*;
6import java.time.LocalDateTime;
7
8@Entity
[97fbc67]9public class ConfirmationTokenW {
[ce6ad22]10
11 @Id
12 @Column(name = "confirmation_token_id")
13 @SequenceGenerator(
[97fbc67]14 name="confirmation_token_sequence_generator_W",
15 sequenceName = "confirmation_token_sequence_W",
[ce6ad22]16 allocationSize = 1,
[97fbc67]17 initialValue = 1200
[ce6ad22]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,
[97fbc67]21 generator = "confirmation_token_sequence_generator_W"
[ce6ad22]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
[97fbc67]36 @ManyToOne(cascade = {CascadeType.ALL})
37 @JoinColumn(nullable = false, name = "vraboten_id")
38 //many confirmation tokens to one registriranParkirac
39 private Vraboten vraboten;
[ce6ad22]40
[97fbc67]41 public ConfirmationTokenW() {}
[ce6ad22]42
[97fbc67]43 public ConfirmationTokenW(int id, String token, LocalDateTime createdAt, LocalDateTime expiresAt, Vraboten vraboten) {
[ce6ad22]44 this.id = id;
45 this.token = token;
46 this.createdAt = createdAt;
47 this.expiresAt = expiresAt;
[97fbc67]48 this.vraboten = vraboten;
[ce6ad22]49 }
50
[97fbc67]51 public ConfirmationTokenW(String token, LocalDateTime createdAt, LocalDateTime expiresAt, Vraboten vraboten) {
[ce6ad22]52 this.token = token;
53 this.createdAt = createdAt;
54 this.expiresAt = expiresAt;
[97fbc67]55 this.vraboten = vraboten;
[ce6ad22]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
[97fbc67]98 public Vraboten getRegistriranParkirac() {
99 return vraboten;
[ce6ad22]100 }
101
[97fbc67]102 public void setRegistriranParkirac(Vraboten vraboten) {
103 this.vraboten = vraboten;
[ce6ad22]104 }
105}
Note: See TracBrowser for help on using the repository browser.