Category Archives: NHibernate

NHibernate 3 Beginners Guide

I am heading towards another mile stone in my life. Later this year my first book will be published. I have always wanted to write a book but never had a topic that is at the same time interesting for … Continue reading 

Also posted in Agile, Behave# | Leave a comment

Ditching domain models for reads

Last week was a tipping point for me.  We had an issue where a production service failed because NHibernate was trying to issue thousands of UPDATE calls for domain objects that we didn’t update.  It turned out that we had … Continue reading 

Also posted in Domain-Driven Design | 9 Comments

New book on NHibernate

Yesterday a new excellent book about NHibernate has been published by (Disclosure: I have been a reviewer thus consider that when reading this post) The book is called “NHibernate 3.0 Cookbook” and can be ordered here. There is even … Continue reading 

Also posted in Agile | Leave a comment

Analyzing historical data and playing with interactive extensions

Introduction In my last post I showed you how we make history an explicit domain concept. This time I want to show you how we use the history of the cages to generate bills. In our Zoo each cage has … Continue reading 

Also posted in Agile | Leave a comment

Making history explicit

Introduction In one product of our solution we needed to record the full history of some entities. What does this mean? It means we create a history entry whenever the state of the corresponding entity changes. When doing this there … Continue reading 

Also posted in Misc | Leave a comment

Ad-hoc mapping with NHibernate

In my recent adventures with massive bulk processing, there are some times when I want to pull bulk loaded tables from SQL, but don’t want to go through all the trouble of building a mapping in NHibernate.  For example, one … Continue reading 


Using Fluent NHibernate With Legacy Databases

I am currently working on a project that has a requirement that it be able to access  data from a legacy SQL Server database. One feature of this system is the ability to add and store checking accounts. These checking … Continue reading 

Also posted in Agile, Testing | Leave a comment

Bulk processing with NHibernate

On a recent project, much of the application integration is done through bulk, batch processing.  Lots of FTP shuffling, moving files around, and processing large CSV or XML files.  Everything worked great with our normal NHibernate usage, until recently when … Continue reading 


Implementing Domain Queries

My current Repository interface looks something like this: public interface IRepository { T FindOne<T>(int id); T FindBy<T>(Expression<Func<T, bool>> expression); IEnumerable<T> FindAllBy<T>(Expression<Func<T, bool>> expression); IEnumerable<T> FindAll<T>(); T FindOneBy<T>(Expression<Func<T, bool>> expression); void Save<T>(T target); void Update<T>(T target); void SaveOrUpdate<T>(T target); void Delete<T>(T … Continue reading 

Also posted in Agile | Leave a comment

Migrating to Fluent NHibernate

Recently, I’ve been entrenched in migrating our existing hbm.xml mapping files to Fluent NHibernate.  Having been through other OSS upgrades, I was expecting something along the lines of pulling teeth.  I pictured a branch, tedious work to try and move … Continue reading