Is it possible to do lazy-loading of many-to-one children (ie. children that are not collections) with NHibernate? I've done a search on this and couldn't find anything, but I'm sure someone must have posted about this before.
Obviously it would require me to modify the code in my class, but that should be fairly simple and I think it could be quite helpful. Something like this:
Code:
class Parent
{
private Child lazyChild;
public Child LazyChild
{
get
{
if (lazyChild == null)
lazyChild = GetSession().LoadLazyChild(this, "lazyChild");
return lazyChild;
}
set { lazyChild = value; }
}
}
Of course, it gets more tricky if the child is optional (ie. null is a valid value).