source: src/main/java/com/example/villadihovo/model/reservations/ReservationForActivity.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: 1020 bytes
Line 
1package com.example.villadihovo.model.reservations;
2
3import com.example.villadihovo.model.offers.Activities;
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(ReservationForActivityId.class)
16@Table(name = "reservation_for_activity")
17public class ReservationForActivity {
18
19 @Id
20 @Column(name = "reservation_id")
21 private Integer reservation_id;
22
23 @Id
24 @Column(name = "activity_id")
25 private Integer activity_id;
26
27
28 @ManyToOne(cascade = CascadeType.ALL)
29 @JoinColumn(name = "reservation_id", referencedColumnName = "reservation_id", insertable = false, updatable = false)
30 private Reservation reservation;
31
32 @ManyToOne
33 @JoinColumn(name = "activity_id", referencedColumnName = "activity_id", insertable = false, updatable = false)
34 private Activities activity;
35
36}
Note: See TracBrowser for help on using the repository browser.