I use the latest FNH and it still doesn't work. I have to explicitely set LazyLoad on the classmap to get this behavior. I understand the difference between the 2 lazyload methods but I don't understand when you say:
> however, the class gets precedence, so if your class isn't set > to lazy load (which was the default) then the references call won't have any > effect. Logically, if the entity is not forced to LazLoad then calling it or not on the association WOULD MAKE a difference. If you force it on the classmap then calling LazyLoad on the association would not change anything. If a NotLazyLoaded was possible on the association, then this one would make a difference. No? About trying with hbm, unfortunately, I tried to learn FNH before HBM so this is not something I can immediately try. N. On Jan 26, 7:14 am, James Gregory <jagregory....@gmail.com> wrote: > @Nicolas: How old is your copy of Fluent NHibernate? Originally it was the > default that all entities would be not lazy loaded; so if your copy is from > then, you won't see the lazy load behaviour. > The two different lazy load methods you spoke of do different things, the > lazy load on the class sets it at the entity level, so whenever that entity > is referenced anywhere it's lazy loaded, the other sets it for that specific > relationship; however, the class gets precedence, so if your class isn't set > to lazy load (which was the default) then the references call won't have any > effect. > > As Seb said, the reason the class lazy load requires virtual methods is > because it creates a proxy of the entity. If your methods aren't already > virtual, then your lazy loading won't be working because NHibernate won't > know how to track it. > > So what do you need to do? Update your copy of FNH and try again, failing > that, explicitly set lazy loading in your class and use virtuals; that's the > recommended approach. > > Please note, this isn't a Fluent NHibernate specific issue, you'd be seeing > the same behaviour for standard xml mapping too. > > On Mon, Jan 26, 2009 at 8:57 AM, Paul Batum <paul.ba...@gmail.com> wrote: > > When it comes to issues such as this I am somewhat of a broken record - my > > suggestion is always the same: > > > See if you can get the desired behavior using HBM xml. Once you have > > working xml, we can compare it to what fluent nhibernate is generating and > > see where the problem lies. > > > Paul Batum > > > On Mon, Jan 26, 2009 at 9:16 AM, Chris Marisic <ch...@marisic.com> wrote: > > >> I noticed this also but I assumed I was handling the session > >> incorrectly making it fully load the object but maybe this actually is > >> an issue. > > >> On Jan 25, 9:20 am, VisualHint <cadil...@gmail.com> wrote: > >> > Yes I know that Seb (thx anyway). This was just telling a fact. > >> > My question is about LazyLoad and why it has no effect when called on > >> > a References() call. > > >> > Nicolas > > >> > On Jan 25, 3:44 am, Sebastien Lambla <s...@serialseb.com> wrote: > > >> > > > But doing that has a consequence: All my properties in> the "one" > >> model must be virtual, even the ones that are not related to> fields in my > >> database. > > >> > > That's because the object is created as a proxy. Any of your property > >> may have access or rely on other properties that need to be hydrated from > >> the db. They all need to be virtual so that the first cal can trigger the > >> load. This is an nhibernate thing. > > >> > > -- > >> > > Seb > >> > > _________________________________________________________________ > >> > > Windows Live Messenger just got better .Video display pics, contact > >> updates & more.http://www.download.live.com/messenger --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---