-->
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.  [ 5 posts ] 
Author Message
 Post subject: HQL & Set Question
PostPosted: Mon Nov 17, 2003 8:06 pm 
Newbie

Joined: Mon Nov 17, 2003 7:53 pm
Posts: 15
I have a class called A and it contains a set of class B. Class B in turn has a set of class C, and it in turn has a set of class D. The relationship between these class is one-to-many (<set> <one-to-many></one-to-many></set>)

Now my question is can a perform a query like this using HQL.

select A.B.C.D
from A.B.C
where A.B.C.type='explorer' and A.B.type = 'ford' and A.type='car'

I am trying to avoid doing joins. Can something like this be done or are there alternatives?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2003 1:24 pm 
Newbie

Joined: Mon Nov 17, 2003 7:53 pm
Posts: 15
*bump*


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2003 5:42 pm 
Regular
Regular

Joined: Tue Sep 16, 2003 11:35 am
Posts: 93
Location: San Francisco, CA
why don't you just try it? post any problems you have.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2003 7:55 pm 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
I do not think this is doable without joins


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2003 9:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Yes, you must use explicit joins in the from clause. Please refer to the documentation.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.