Future Query Of implemented
It took very little time to actually make this work. I knew there was a reason liked my stack, it is flexible and easy to work with.
You can check the implementation here, it is about 100 lines of code.
And the test for it:
FutureQueryOf<Parent> futureQueryOfParents = new FutureQueryOf<Parent>(DetachedCriteria.For<Parent>()); FutureQueryOf<Child> futureQueryOfChildren = new FutureQueryOf<Child>(DetachedCriteria.For<Child>()); Assert.AreEqual(0, futureQueryOfParents.Results.Count); //This also kills the database, because we use an in // memory one ,so we ensure that the code is not // executing a second query CurrentContext.DisposeUnitOfWork(); Assert.AreEqual(0, futureQueryOfChildren.Results.Count);
Comments
I might be wrong, but this seems to be something that NHibernate should contemplate because it's intended to optimize database access by batching the queries.
What do you think?
Yes, I agree, please raise it in the list.
Comment preview