-->
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: Key-many-to-one always eagerly fetched
PostPosted: Wed Nov 19, 2008 8:04 pm 
Beginner
Beginner

Joined: Fri May 06, 2005 2:37 pm
Posts: 39
Looking at the SQL output of my test, whenever I load a collection of objects that have a composite key (2 FKs, one property), the FKs are being eagerly fetched, even though the HBM does not turn off lazy loading.

I don't believe there's anything I need to do to cause proxying to happen, and CGLIB is loading properly. Is there anything else I should check?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2008 4:03 pm 
Beginner
Beginner

Joined: Fri May 06, 2005 2:37 pm
Posts: 39
I've made some changes, including removing the references from equals() and substituting the keys for the references as part of the composite key (p.328 of the book). No matter what, when the object is loaded, the reference is initialized. The only thing I can do is set fetch="join" to reduce 60 SQL commands to one.

Is there any reason that I cannot force this many-to-one to be a proxy?


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.