我是Java的新手,所以请尽可能帮忙。 我需要填充Jtable,我正在使用这段代码:
SELECT r.id AS roomID, r.type, r.no_of_rooms, r.no_of_rooms -
COALESCE(t.bookedRooms,0) AS available_rooms FROM room AS r LEFT JOIN (
SELECT room_id, SUM(total_rooms) AS bookedRooms FROM bookings WHERE
`start` < '2017-02-10' AND `ends` > '2017-02-09' GROUP BY room_id ) AS t
ON r.id = t.room_id WHERE r.no_of_rooms - COALESCE(t.bookedRooms,0) > 0
它就像这样。
但是如何使用Hibernate以及如何进行映射呢? 提前谢谢!