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.
|
|