how to disable lazy loading in fn r1.0?
+7
A:
You can try with:
Not.LazyLoad();
inside your mapping constructor.
Darin Dimitrov
2009-09-11 16:48:32
did you try it because i did ... and it's not working
Chen Kinnrot
2009-09-11 20:32:29
it worked for me. I wanted an object reference to be loaded with the object and this did it.
James Jones
2009-11-04 21:24:39
It worked for us also. Our mapping has something like: HasMany(e => e.Children).KeyColumnNames.Add("ParentId").Cascade.AllDeleteOrphan().Not.LazyLoad();
Peter
2009-11-19 10:14:50
+6
A:
Fluently.Configure()
.Database(
SQLiteConfiguration.Standard
.InMemory)
.Mappings( m => m.AutoMappings
.Add( AutoMap.AssemblyOf<_Field>() )
.Conventions
.Add( FluentNHibernate.Conventions.Helpers.DefaultLazy.Never() )
.BuildSessionFactory();
Aaron Fischer
2009-09-12 02:55:17
A:
In my case NH loaded all children when parent was fetched. But each child was fetched by unique query.
maxlego
2010-01-26 07:48:10
"Eager loading" != "no unique query". Eager loading often will use a seperate select statement. Use fetchmode to control this.
Jan Willem B
2010-03-30 09:26:09