-->
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: Setting max_fetch_depth at runtime
PostPosted: Thu Apr 21, 2005 9:36 am 
Newbie

Joined: Fri Mar 18, 2005 3:23 pm
Posts: 7
I am working on an application that returns back a tree structure similar to an org tree. The user can specify the depth to which they want the information retrieved. It would be very convinient for me if I could configure the hibernate.max_fetch_depth parameter at runtime. Is there a way to do this, or something else to the same effect?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 21, 2005 1:04 pm 
Beginner
Beginner

Joined: Thu Nov 25, 2004 7:07 am
Posts: 43
Location: Germany
I think query.setMaxResults(int) will help you. This method is available for Criteria, too. Unfortunatelly you can't sepcify a min range to be able to fetch rows from e.g. 1000 to 2000

Regards,
caterham

_________________
You'll never get a second chance to make a first impression!


Top
 Profile  
 
 Post subject: Will not guarantee depth
PostPosted: Thu Apr 21, 2005 1:34 pm 
Newbie

Joined: Fri Mar 18, 2005 3:23 pm
Posts: 7
Max results will not guarantee a certain depth, only a number of elements returned.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 21, 2005 2:50 pm 
Beginner
Beginner

Joined: Thu Nov 25, 2004 7:07 am
Posts: 43
Location: Germany
You're right. I read it wrong. But I think a max depth will be hard to set. Did you try to build such a query in SQL? If I am not wrong, Oracle has the possibility to set a level when using aggregate functions like GROUP BY. But I am not sure if this works with a hibernate query.

_________________
You'll never get a second chance to make a first impression!


Top
 Profile  
 
 Post subject: It already is configurable
PostPosted: Thu Apr 21, 2005 2:53 pm 
Newbie

Joined: Fri Mar 18, 2005 3:23 pm
Posts: 7
You can set this option at start up time, and I was wondering if it is possible to access it at run time, to make a "connect by with depth" possible. This way the collections are fetched up to a point.


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.