LightSpeed and Eager Loaded properties
Today Mindscape, the makers of the ORM LightSpeed and other awesome products posted a blog on Lazy-Loading/Eager-Loading properties with LightSpeed.
Why can't NHibernate do this! And when I say why can't NHibernate do this, I mean, why can't NHibernate do this with Query/QueryOver.
Ayende detailed this time last year, the ability to lazy-load properties, but currently Query/QueryOver only support One-To-Many and One-To-One relationships.
NHibernate will support the ability to Lazy-Load a property but you can't specify it to be eager loaded.
So you do
Map(x => x.FullDescription).CustomSqlType("NTEXT")
.LazyLoad();
Running a query would result in:
Great... But you currently cannot do:
var video = session.QueryOver<Video>()
.Fetch(x => x.FullDescription).Eager
.List();
This will execute, the exact same query.
I do have one gripe with the way LightSpeed works tho, and that is that you have to give your aggregate as a string name, I really think they should give the ability to specify the property(ies) via a lambda.
Without giving it a test drive, I feel if I changed the name of the aggregate and forgot to update everywhere it was referenced, I'm going to end up with a maintenance nightmare.
Anyway checkout LightSpeed, it's awesome, it's everything Entity Framework should have been.
http://www.mindscapehq.com/products/lightspeed
comments powered by Disqus