-->
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.  [ 3 posts ] 
Author Message
 Post subject: Always fetching ID even though lazy is true?
PostPosted: Tue Jul 17, 2007 7:22 am 
Beginner
Beginner

Joined: Tue May 08, 2007 8:26 am
Posts: 21
It's not that big of a deal but still, i've got a small problem:

For example:
I've got a many-to-one association, which has lazy="no-proxy" mapped.
Now when I load this through a session createQuery, i see in the sql log files that the many-to-one his ID is fetched.
Why is this?
Is it possible to ignore this?

I've got a table which is queried alot but has alot of foreign keys which i do not always need, perhaps a small improvement can be made by optimizing this.

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 17, 2007 10:49 am 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
How would Hibernate know which related row to load when you went to initialize that lazy many-to-one?

_________________
Chris Bredesen
Senior Software Maintenance Engineer, JBoss


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 19, 2007 2:16 am 
Beginner
Beginner

Joined: Tue May 08, 2007 8:26 am
Posts: 21
Is there no option to turn this off?
I know in some cases I will not need the information but it will always fetch it, which makes the db do more work.

I see that Hibernate wants to know what object to load but I don't always need the object, is there no way to turn it off?

Thanks


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