source: src/main/java/com/example/villadihovo/model/reservations/ReservationForEvents.java

Last change on this file 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: 961 bytes
Line 
1package com.example.villadihovo.model.reservations;
2
3import com.example.villadihovo.model.offers.Events;
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(ReservationForEventsId.class)
16@Table(name = "reservation_for_events")
17public class ReservationForEvents {
18 @Id
19 @Column(name = "reservation_id")
20 private Integer reservation_id;
21
22 @Id
23 @Column(name = "event_id")
24 private Integer event_id;
25
26 @ManyToOne
27 @JoinColumn(name = "reservation_id", referencedColumnName = "reservation_id", insertable = false, updatable = false)
28 private Reservation reservation;
29
30 @ManyToOne
31 @JoinColumn(name = "event_id", referencedColumnName = "event_id", insertable = false, updatable = false)
32 private Events event;
33}
Note: See TracBrowser for help on using the repository browser.