-->
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.  [ 4 posts ] 
Author Message
 Post subject: Loading of object graphs via many-to-one associations
PostPosted: Mon Jan 26, 2004 1:26 pm 
Newbie

Joined: Wed Nov 05, 2003 6:47 am
Posts: 14
Hello,

I have a common question regarding the object graph loading.
We have a lot of many-to-one associations in our application, so it would be great if hibernate would resolve them by using outer join (we use OracleDialect, so it should be possible), and not by executing extra queries for each association. I've already played with different initialization parameters (e.g. max_fetch_depth) with no effect.

Is there any way to let hibernate generate as few queries as possible without using proxies?
Or may be there is a possibility to let many-to-one associations be lazy initialized (like collections)? I've read that it could be possible via proxies, but proxies have several limitations that are not acceptable in our case...

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 26, 2004 1:30 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
The one-side of a many-to-one can only be lazyli fetched using a proxy. Read http://www.hibernate.org/162.html. The same reasons on why this is only possible with proxys apply in this case.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 26, 2004 1:46 pm 
Newbie

Joined: Wed Nov 05, 2003 6:47 am
Posts: 14
Hi,

at first, thanks a lot for the quick reply!

So, the situation with proxies and lazy initialization seems to be clear. But beyond lazy initialization, what about outer join fetching? This would drastically decrease the number of generated queries...

Regards,
Michail.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 26, 2004 1:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can use outer join loading by using hibernate.max_fetch_depth > 0 and outer-join=true on the collections or the many-to-one element.


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