-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Help with difficult HQL
PostPosted: Tue Jan 09, 2007 8:55 am 
Newbie

Joined: Thu Jun 08, 2006 4:08 am
Posts: 8
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))
)


Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 09, 2007 2:37 pm 
Newbie

Joined: Thu Jun 08, 2006 4:08 am
Posts: 8
None with any helpful information on this topic?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.