-->
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.  [ 1 post ] 
Author Message
 Post subject: Loading grandchild loads child and parent
PostPosted: Wed Feb 02, 2005 9:54 pm 
Newbie

Joined: Thu Jan 06, 2005 6:27 pm
Posts: 10
I have a parent-child-grandchild relationship (A-B-C). A can have many Bs and B can have many Cs. B and C have composite ids. B has (A_id, B_id) as PK and C has (A_id, B_id, C_id) as PK. (This is a legacy schema with natural business keys throughout). All ids are assigned.

My problem is that when I load C using session.createQuery(..), Hibernate runs queries to load A and B too. I have set lazy="true" and outer-join="false" in all mapping files. I am 100% certain I am not accessing A and B at all. I also tried session.createCriteria(..).setFetchMode(..) but no effect. No matter what I do, it wants to load A and B.

Is there a way out? Could the fact that I am using composite ids have anything to do with this? At this point, I have to resort to straight JDBC to avoid the extra queries, any help will be very much appreciated.

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.