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