-->
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: Not lazy=false and not left join fecth, but depth feature
PostPosted: Thu Jul 08, 2004 5:51 pm 
Beginner
Beginner

Joined: Wed Jan 21, 2004 10:52 pm
Posts: 27
Location: Santa Cruz do Sul - RS - Brazil
Hi all,
I'm using Hibernate and all features is very good.
However, in some cases I need to load an object with yours collections. In these cases the Hibernate have the lazy and fetch features.
But, I need this behavior in some cases.
So, it would be interesting an depth keyword in HQL.
Thus, it would be possible create these queries:
Code:
"from Group g left join fecth depth 3 u.groups"
"from Group g left join fecth depth 2 u.groups g1 left join fecth depth 5 g1.groups"
"from Group g left join fetch depth * u.groups"

This queries returns, respectively:
The group and yours 3 superior groups.
The group and yours 2 superiors groups and, for each of these groups, yours 5 superiors groups.
The group and all hierarchy of superior groups.

PS> Considering that a group have an auto-relationship, and the lazy attribute equals true.

Well, its my sugestion for Hibernate team.

_________________
Do you still create DTO factories? Oh, no!
Try DTOptimzier now!
https://dtoptimizer.dev.java.net/


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 08, 2004 5:54 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
This is not possible with Hibernate, in fact, it is not even possible with SQL. You have to use vendor-specific extensions, such as "CONNECT BY" in Oracle or "SELECT RECURSIVE" in DB2. You may execute these queries with session.createSqlQuery().

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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.