I'm running an application simulates selling air plane tickets.
Using a simple schema (1-n):
SEAT
------
id_seat
description
position
BOOKING
---------
id
customer
id_seat
I'd like to produce a Query using either JPA API or Criteria which provides me a list of all available SEATs. That is, all SEAT Objects which do not exist (not booked) in the BOOKING table. (SEAT.id_seat = BOOKING.id_seat
)
Can anybody give me a clue which is the best option to produce such a Query?