-->
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: Lazy vs Eager
PostPosted: Fri Jun 15, 2007 6:40 am 
Beginner
Beginner

Joined: Fri Jun 15, 2007 6:32 am
Posts: 23
hi ,

i have a class TimeSample that holds a SET<Sample> with both relationships set with annotations of onetomemany and manytoone with mapping by i'm using jboss and spring framework aswell , when accessing the timesample entity it throws a hibernate lazy exception which i've solved with fetch=fetchtype.eager in the anonnation of the onetomany but it doesn't not seem logicaly right to me to force the entire fetch when i use a timesample entity i don't neccisarly want that field and it looks like a waste of resources is there anyway to define eager only when accessing the SET ?
and on that issue what reading have i missed because i generaly don't understand why if default is set to lazy doesn't it crash on every entity access
(i gather that when asked to query for foreignkeys relathionship it will crash ?)
thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 15, 2007 7:21 am 
Newbie

Joined: Tue Jul 12, 2005 6:55 pm
Posts: 9
Could you provide code for your classes and a way how you access the object? Then we might help :-)


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.