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 | |
---|
1 | package com.example.villadihovo.model.reservations;
|
---|
2 |
|
---|
3 | import com.example.villadihovo.model.users.UserTable;
|
---|
4 | import jakarta.persistence.*;
|
---|
5 | import lombok.AllArgsConstructor;
|
---|
6 | import lombok.Data;
|
---|
7 | import lombok.NoArgsConstructor;
|
---|
8 | import org.hibernate.annotations.OnDelete;
|
---|
9 | import org.hibernate.annotations.OnDeleteAction;
|
---|
10 |
|
---|
11 | @Data
|
---|
12 | @AllArgsConstructor
|
---|
13 | @NoArgsConstructor
|
---|
14 | @Entity
|
---|
15 | @IdClass(GuestMakeReservationId.class)
|
---|
16 | @Table(name = "guests_make_reservation")
|
---|
17 | public 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.