source: src/main/java/com/example/villadihovo/model/reservations/GuestsMakeReservation.java@ f7c05a1

Last change on this file since f7c05a1 was f7c05a1, checked in by Elena Shulevska <elena.shulevska@…>, 15 months ago

initial commit of the source code on origin

  • Property mode set to 100644
File size: 992 bytes
Line 
1package com.example.villadihovo.model.reservations;
2
3import com.example.villadihovo.model.users.UserTable;
4import jakarta.persistence.*;
5import lombok.AllArgsConstructor;
6import lombok.Data;
7import lombok.NoArgsConstructor;
8import org.hibernate.annotations.OnDelete;
9import org.hibernate.annotations.OnDeleteAction;
10
11@Data
12@AllArgsConstructor
13@NoArgsConstructor
14@Entity
15@IdClass(GuestMakeReservationId.class)
16@Table(name = "guests_make_reservation")
17public class GuestsMakeReservation {
18
19 @Id
20 @Column(name = "user_id")
21 private Integer user_id;
22
23 @Id
24 @Column(name = "reservation_id")
25 private Integer reservation_id;
26
27 @ManyToOne
28 @JoinColumn(name = "user_id", referencedColumnName = "user_id", insertable = false, updatable = false)
29 private UserTable user;
30
31 @ManyToOne(cascade = CascadeType.ALL)
32 @JoinColumn(name = "reservation_id", referencedColumnName = "reservation_id", insertable = false, updatable = false)
33 private Reservation reservation;
34
35}
Note: See TracBrowser for help on using the repository browser.