-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
NHibernate 4.x Cookbook - Second Edition
By :
Often, when we query for some set of entities, we also need to load a few children of those entities. In the Eager loading with… recipe, in the previous chapter, we learned how to use different fetch syntaxes to eager load referenced entities and collection. We concluded that there are a few scenarios where the standard methods don't work as desired. In this recipe, we'll show you how to use subqueries and/or NHibernate's Futures, together with the session cache, to overcome these issues.
Complete the Getting Ready instructions at the beginning of Chapter 4, Queries.
Add a new folder named AdvancedEagerLoading to the QueryRecipes project.
Add a new class named Recipe to the folder:
using System.Linq;
using NH4CookbookHelpers.Queries;
using NH4CookbookHelpers.Queries.Model;
using NHibernate;
using NHibernate.Linq;
namespace QueryRecipes.AdvancedEagerLoading
{
public class Recipe : QueryRecipe
{
}
}Add a new method to Recipe to...