0

I want to retrieve Screening with Seat and with Booking by booking id. Screening has a one-to-many relationship with Seat and Seat has a one-to-many relationship with Booking (a seat can have multiple bookings, but only one can be active, the rest must be canceled). I wrote such a method, but it gets MultipleBagException:

@Query("select s from booking_screening s join fetch s.seats se join fetch se.bookings b where b.id = :bookingId")
Optional<Screening> readByBookingId(@Param("bookingId") Long booking);
Sampeteq
  • 123
  • 8
  • i think this might help you. Check the answers. https://stackoverflow.com/questions/4334970/hibernate-throws-multiplebagfetchexception-cannot-simultaneously-fetch-multipl – rahulP Aug 01 '23 at 08:07

0 Answers0