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: Unfetching lazy association
PostPosted: Wed Apr 18, 2007 1:51 pm 
Beginner
Beginner

Joined: Wed Apr 18, 2007 1:44 pm
Posts: 27
Hi all,
I wonder if it's possible to unfetch a lazy association, that is, to revert it back to the state it was before being accessed. The motivation is the need to serialize a relatively tiny entity which has a number of associations to drop-down-like stuff, with name, description, etc. that is pointless to serialize too. Had I used a dto I would have serialized just the ids instead. Is there any way to achieve something similar with hibernate?
TIA.
Cheers,
Carlos


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 18, 2007 1:57 pm 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
Since it is an implementation of a proxy pattern, I'm pretty sure there's no way to "uninitialize" the associations. Of course, since it is just a POJO, why not just set the associated entities to null before you serialize them?


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.