-->
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: HQL query : All ManyToOne are eagerly loaded
PostPosted: Fri Jun 16, 2006 9:44 am 
Newbie

Joined: Thu Apr 06, 2006 2:09 pm
Posts: 14
I have some Business Objects that have ManyToOne associations with default fetch type for Hibernate 3 (LAZY).
If I load one of those objects using session.get(..) I get a cglib proxy as expected and thus my ManyToOne's are not loaded until I access them.

The problem is if I load one of those objects using HQL, I get the concrete class, not the proxy and Hibernate is performing necessary query to get my ManyToOne's loaded (that's not what I want). Other associations type are fine (lazy).

Is it a normal behaviour ? Is it possible to get a proxy when using HQL ?

Thanks

Aymeric


Top
 Profile  
 
 Post subject: Re: HQL query : All ManyToOne are eagerly loaded
PostPosted: Wed Nov 22, 2006 9:08 am 
Newbie

Joined: Fri Dec 17, 2004 2:38 pm
Posts: 11
Location: Buenos Aires
Same problem here!

There is a way to avoid compile time instrumentation??? to get proxies in HQL an criteria??

mrik wrote:
I have some Business Objects that have ManyToOne associations with default fetch type for Hibernate 3 (LAZY).
If I load one of those objects using session.get(..) I get a cglib proxy as expected and thus my ManyToOne's are not loaded until I access them.

The problem is if I load one of those objects using HQL, I get the concrete class, not the proxy and Hibernate is performing necessary query to get my ManyToOne's loaded (that's not what I want). Other associations type are fine (lazy).

Is it a normal behaviour ? Is it possible to get a proxy when using HQL ?

Thanks

Aymeric


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.