-->
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: Query.iterate() ignores class-level lazy="false"?
PostPosted: Wed Dec 06, 2006 2:42 pm 
Beginner
Beginner

Joined: Mon Sep 27, 2004 4:28 pm
Posts: 44
Hibernate version: 3.2

I've got lazy="false" in my <class> element of my hibernate mapping file. I did this when proxying became the default behavior in 3.0. Unfortunately, now I have a case where the same query run via .list() returns me non-proxied objects... but calling .iterate() returns me CGLib proxies. I can't find anywhere this behavior is documented, or expected.

Is this what I should expect from .iterate() or is this a bug?

Thanks in advance.

btw: I promise to give credits to remotely helpful responses!!!

-Phill


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 06, 2006 2:49 pm 
Beginner
Beginner

Joined: Mon Sep 27, 2004 4:28 pm
Posts: 44
Um. Rad. Solved my own problem. I'll document it for anyone else who might be stumped:

My issue was one of inheritance.. Though my <class> element specified lazy="false", I had two subclasses which did not. Adding lazy="false" to both <subclass> elements solves the problem.

If any developers are listening, I'd suggest a small change to this behavior. When a subclass specifies lazy="false", I think it makes sense for that to apply as the default for it's subclasses. Seems more intuitive to me, but I might just be slow :)

Thanks.


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.