O'Reilly logo

NHibernate 4.x Cookbook - Second Edition by Jason Dentler, Alexander Zaytsev, Gunnar Liljas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using named queries in the data access layer

Named queries encapsulated in query objects are a powerful combination. In this recipe, we will show you how to use named queries with your data access layer.

Getting ready

To complete this recipe, you will need the common service locator from Microsoft patterns and practices. The documentation and source code can be found at http://commonservicelocator.codeplex.com.

Complete the previous recipe: Setting up an NHibernate repository.

Following Fast testing with SQLite in-memory database recipe in Chapter 6, Testing, create a new NHibernate test project named Eg.Core.Data.Impl.Test.

Include the Eg.Core.Data.Impl assembly as an additional mapping assembly in your test project's App.Config with the following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required