-->
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.  [ 1 post ] 
Author Message
 Post subject: Use Struts2 w/ Hibernate without getting lazy collections?
PostPosted: Fri Apr 13, 2012 3:13 pm 
Newbie

Joined: Tue Feb 14, 2012 11:58 pm
Posts: 7
Hi all,

I have an object with collections, which I have made Lazy, because sometimes I just want to grab the columns in the object itself, without grabbing information from the related tables. However, every time I load this object I am going to get a "LazyInstantiationException" when I pass it on to the struts xslt result. What is the best practice in getting around this? After reading around about it I thought I could just create a Hibernate filter to open the element in the view, but it seems that this just grabs the lazy collections from the database anyway, which is what I am trying to avoid in the first place. Do I have to create and return some kind of wrapper for the original element that hides the lazy collections? This does not seem a very efficient way to do things.

Thank you in advance for the help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.