source: src/main/java/finki/it/terapijamkbackend/spring/entities/Request.java

Last change on this file was 743de55, checked in by macagaso <gasoskamarija@…>, 6 weeks ago

Initial commit

  • Property mode set to 100644
File size: 949 bytes
Line 
1package finki.it.terapijamkbackend.spring.entities;
2
3import jakarta.persistence.*;
4import lombok.*;
5
6import java.time.LocalDateTime;
7
8@Getter
9@Setter
10@EqualsAndHashCode
11@NoArgsConstructor
12@Entity(name = "Request")
13@Table(name="requests")
14public class Request {
15
16 @SequenceGenerator(
17 name="request_sequence",
18 sequenceName = "request_sequence",
19 allocationSize = 1
20 )
21 @Id
22 @GeneratedValue(
23 strategy=GenerationType.SEQUENCE,
24 generator = "request_sequence"
25 )
26 private Long id;
27
28 private String couponCode;
29 private String additionalInfo;
30 private LocalDateTime term;
31 @ManyToOne
32 @JoinColumn(name="user_id")
33 private User user;
34
35 public Request(User user,LocalDateTime term,String couponCode,String additionalInfo){
36 this.user=user;
37 this.term=term;
38 this.couponCode=couponCode;
39 this.additionalInfo=additionalInfo;
40 }
41
42}
Note: See TracBrowser for help on using the repository browser.