-->
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.  [ 4 posts ] 
Author Message
 Post subject: Fully load hibernate object
PostPosted: Wed Apr 02, 2008 3:45 pm 
Beginner
Beginner

Joined: Mon Nov 19, 2007 4:40 pm
Posts: 46
Hibernate version:
3.2

I have searched around, but can't seem to find an answer.

I have certain fields in my mapping set to lazily load. This is what i want most of the time. But, i was wondering if there was a way to tell hibernate on a case by case basis to load everything all at once (including all my lazy fields and all the fields inside the lazy fields). Basically, there are times, i want to load every piece of data all the way to the bottom. Does anyone know if this is possible?

If not, does anyone know if I used the clone method in Apache Commons SerializationUtils (http://commons.apache.org/lang/api/org/apache/commons/lang/SerializationUtils.html#clone(java.io.Serializable) whether or not this would accomplish the same thing? This should be an easy test for me, but i wanted to know if there was a more efficient and direct way to force the loading of all fields.

Thanks,

Paul


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 16, 2008 2:25 pm 
Beginner
Beginner

Joined: Mon Nov 19, 2007 4:40 pm
Posts: 46
I wanted to refresh this topic for one more chance at an answer... so, does anyone have any ideas? I have a deadline approaching quickly and i am hoping for a solution.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 16, 2008 2:46 pm 
Beginner
Beginner

Joined: Fri Aug 24, 2007 4:46 am
Posts: 36
Location: Bielefeld / Germany
Did you read the docs about fetching strategies?

http://www.hibernate.org/hib_docs/v3/re ... e-fetching

Maybe Hibernate.initialize(yourEntity) is enough to solve your problem.

HTH, Maik


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 17, 2008 11:33 am 
Beginner
Beginner

Joined: Mon Nov 19, 2007 4:40 pm
Posts: 46
I have read the docs at some point in time... but that was a while ago, so I will go through them again to see if there is a solution in there. Thanks!


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