source: src/main/java/com/example/skychasemk/model/Booking.java@ 57e58a3

Last change on this file since 57e58a3 was 57e58a3, checked in by ste08 <sjovanoska@…>, 4 months ago

Initial commit

  • Property mode set to 100644
File size: 2.7 KB
Line 
1package com.example.skychasemk.model;
2
3import jakarta.persistence.*;
4import lombok.Getter;
5import lombok.Setter;
6
7import java.math.BigDecimal;
8import java.time.LocalDate;
9
10@Entity
11@Table(name="Booking")
12public class Booking {
13
14 @Setter
15 @Getter
16 @Id
17 @GeneratedValue(strategy = GenerationType.IDENTITY)
18 @Column(name = "BookingID")
19
20 private Integer bookingID;
21 @Setter
22 @Getter
23 @Column(name = "UserID")
24
25 private Integer userID;
26
27 //@Column(name = "flightid")
28
29 //private Integer flightId;
30 @Column(name = "booking_date")
31
32 private LocalDate booking_date;
33 @Setter
34 @Getter
35 @Column(name = "payment_status")
36
37 @Enumerated(EnumType.STRING)
38 private payment_status status;
39 @Column(name = "total_cost")
40
41 private BigDecimal total_cost;
42 @Column(name = "seat_number")
43
44 private Integer seat_number;
45
46 @ManyToOne(fetch = FetchType.LAZY)
47 @JoinColumn(name = "flightid")
48 Flight flightId;
49
50 public Flight getFlightId() {
51 return flightId;
52 }
53
54 public void setFlightId(Flight flightId) {
55 this.flightId = flightId;
56 }
57
58 public enum payment_status {
59 PENDING,
60 COMPLETED,
61 CANCELLED
62 }
63
64 public LocalDate getBookingDate() {
65 return booking_date;
66 }
67
68 public Integer getBookingID() {
69 return bookingID;
70 }
71
72 public void setBookingID(Integer bookingID) {
73 this.bookingID = bookingID;
74 }
75
76 public Integer getUserID() {
77 return userID;
78 }
79
80 public void setUserID(Integer userID) {
81 this.userID = userID;
82 }
83
84 public LocalDate getBooking_date() {
85 return booking_date;
86 }
87
88 public void setBooking_date(LocalDate booking_date) {
89 this.booking_date = booking_date;
90 }
91
92 public payment_status getStatus() {
93 return status;
94 }
95
96 public void setStatus(payment_status status) {
97 this.status = status;
98 }
99
100 public BigDecimal getTotal_cost() {
101 return total_cost;
102 }
103
104 public void setTotal_cost(BigDecimal total_cost) {
105 this.total_cost = total_cost;
106 }
107
108 public Integer getSeat_number() {
109 return seat_number;
110 }
111
112 public void setSeat_number(Integer seat_number) {
113 this.seat_number = seat_number;
114 }
115
116 public void setBookingDate(LocalDate bookingDate) {
117 this.booking_date = bookingDate;
118 }
119
120 public BigDecimal getTotalCost() {
121 return total_cost;
122 }
123
124 public void setTotalCost(BigDecimal totalCost) {
125 this.total_cost = totalCost;
126 }
127
128 public Integer getSeatNumber() {
129 return seat_number;
130 }
131
132 public void setSeatNumber(Integer seat_number) {
133 this.seat_number = seat_number;
134 }
135}
Note: See TracBrowser for help on using the repository browser.