-->
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: the need for "join" in queries
PostPosted: Tue May 24, 2005 8:01 am 
Newbie

Joined: Tue May 24, 2005 7:19 am
Posts: 7
Location: Ankara,Turkiye
Hibernate version: 2.1.7

Hi,

Is it possible to write a query in hibernate like,

"from Parent parent where parent.child.age=3"

and even

"from Parent parent where parent.children.age=3"

where I assume that parent entity has a composite-element list of child, children.

or we need to explicitly write the join.

"from Parent p join p.Child child where child.age =3"

if JOIN is necessary, I have not understood the need for the JOIN in those kind of queries. What can go wrong if we write queries like the first 2-joinless ones?

I guess it can be possible for the hibernate core to parse query, match mappings and then construct the SQL query with necessary JOINs.

Thanks in advance.


Top
 Profile  
 
 Post subject: composite-element list queries
PostPosted: Thu May 26, 2005 3:24 am 
Newbie

Joined: Tue May 24, 2005 7:19 am
Posts: 7
Location: Ankara,Turkiye
I rephrase my question as

it is possible form queries without join like

"from Parent parent where parent.child.age=3"

but I still can not perform a query like

"from Parent parent where parent.children.age=3"

where I assume that parent entity has a composite-element list of child, children.

I have not understood the need for the JOIN in those kind of queries. What can go wrong if we write queries without join? Is it supported in hibernate 3? Will it be supported in future versions? Or is it not possible?


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.