Ok, first of all take a look at the UML class diagram below. The are get and set properties for each attributes in the class.
So, here is the question:
How can I get a List with two columns (which is result of the query), where the first column is one Roomtype and second a List of Rooms (which has this Roomtype as parent) where each room has
not BookingLine in their bookingLines list where BookingLine.bookingHead.FromDate = 01.02.2007 and BookingLine.BookingHead.ToDate = 05.02.2007.
With the query below, I am getting all the rooms with my criteria, but I want to group these rooms for each Roomtype so in the result List I will get these columns for each element:
"Double Room", {Room (id=1),Room(id=4), Room(id=2)}
"Single Room", {Room (id=3)}
..
..
..
Code:
select r
from Room r
where r not in
(
select b.Room
from BookingLine b
where ( (b.BookingHead.FromDate = :fromDate) AND (b.BookingHead.FromDate = :fromDate))
)