-->
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: getId call for many-to-one retrieves the 'one' entity
PostPosted: Tue Dec 27, 2005 11:58 am 
Newbie

Joined: Thu Jun 30, 2005 8:18 am
Posts: 6
Hi,

I have a simple bidirectional parent <-> child mapping where
parent has a one-to-many mapped set of children and child has a many-to-one mapping for its parent. (Hibernate 3, everything lazy)

If I do a child.getParent().getId() hibernate executes a loading query for the parent. To my understanding this load should not happen. I expect a proxy from getParent() and the proxy is able to execute getId without going to the database because the id of parent is part of the child database row.

Any ideas why this does not work as I expect it to?


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.