Changeset 8ca35dc for src/main/java/com/example/rezevirajmasa/demo/model
- Timestamp:
- 01/19/25 23:18:37 (4 months ago)
- Branches:
- main
- Children:
- f5b256e
- Parents:
- db39d9e
- Location:
- src/main/java/com/example/rezevirajmasa/demo/model
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/rezevirajmasa/demo/model/Reservation.java
rdb39d9e r8ca35dc 16 16 17 17 @ManyToOne 18 @JoinColumn(name = " CustomerID")19 private Customer customer;18 @JoinColumn(name = "UserID") 19 private User user; 20 20 21 21 @ManyToOne … … 68 68 } 69 69 70 public Reservation( Customer customer, TableEntity table, Restaurant restaurant, LocalDateTime reservationDateTime, int partySize, String specialRequests, String status, LocalDateTime checkInTime, LocalDateTime checkOutTime, String paymentStatus) {70 public Reservation(User user, TableEntity table, Restaurant restaurant, LocalDateTime reservationDateTime, int partySize, String specialRequests, String status, LocalDateTime checkInTime, LocalDateTime checkOutTime, String paymentStatus) { 71 71 // this.customer = customer; 72 72 this.table = table; 73 this.user = user; 73 74 this.restaurant = restaurant; 74 75 this.reservationDateTime = reservationDateTime; … … 81 82 } 82 83 84 public User getUser() { 85 return user; 86 } 87 88 public void setUser(User user) { 89 this.user = user; 90 } 91 83 92 public Long getReservationID() { 84 93 return reservationID; … … 89 98 } 90 99 91 public Customer getCustomer() {92 return customer;93 }94 95 public void setCustomer(Customer customer) {96 this.customer = customer;97 }98 100 99 101 public TableEntity getTable() { … … 173 175 return "Reservation{" + 174 176 "reservationID=" + reservationID + 175 ", customer=" + customer +177 ", customer=" + user + 176 178 ", table=" + table + 177 179 ", restaurant=" + restaurant + -
src/main/java/com/example/rezevirajmasa/demo/model/Restaurant.java
rdb39d9e r8ca35dc 151 151 @ManyToOne 152 152 @JoinColumn(name = "customer_id") 153 private Customer customer;153 private User user; 154 154 155 155 @ManyToOne … … 179 179 private LocalDateTime checkInDate; 180 180 181 public ReservationHistory( Customer customer, TableEntity table, Restaurant restaurant, LocalDateTime reservationDateTime, int partySize, String specialRequests, String status, String cancellationReason, LocalDateTime checkInDate) {182 this. customer = customer;181 public ReservationHistory(User user, TableEntity table, Restaurant restaurant, LocalDateTime reservationDateTime, int partySize, String specialRequests, String status, String cancellationReason, LocalDateTime checkInDate) { 182 this.user = user; 183 183 this.table = table; 184 184 this.restaurant = restaurant; … … 202 202 } 203 203 204 public Customer getCustomer() {205 return customer;206 } 207 208 public void set Customer(Customer customer) {209 this. customer = customer;204 public User getUser() { 205 return user; 206 } 207 208 public void setUser(User user) { 209 this.user = user; 210 210 } 211 211 … … 278 278 return "ReservationHistory{" + 279 279 "id=" + id + 280 ", customer=" + customer +280 ", user=" + user + 281 281 ", table=" + table + 282 282 ", restaurant=" + restaurant + -
src/main/java/com/example/rezevirajmasa/demo/model/User.java
rdb39d9e r8ca35dc 7 7 import lombok.NoArgsConstructor; 8 8 import org.springframework.web.bind.annotation.GetMapping; 9 10 import java.util.Date; 9 11 10 12 @AllArgsConstructor … … 31 33 @Column(nullable = false) 32 34 private String password; 35 36 @Enumerated(EnumType.STRING) 37 private Role role; 38 39 @Column(name = "Phone", length = 20) 40 private String phone; 41 42 @Column(name = "Address", columnDefinition = "TEXT") 43 private String address; 44 45 @Enumerated(EnumType.STRING) 46 @Column(name = "MembershipLevel", length = 20) 47 private MembershipLevel membershipLevel; 48 49 @Column(name = "RegistrationDate", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") 50 @Temporal(TemporalType.TIMESTAMP) 51 private Date registrationDate; 33 52 }
Note:
See TracChangeset
for help on using the changeset viewer.