Monthly Archives: March 2008

Creating a Timestamp Interceptor in NHibernate

In a previous post, I gave an example of a Timestamp class and how one might create an ICompositeUserType to map it within NHibernate. Here I want to show of an example of an IInterceptor which will automatically populate the … Continue reading 

Posted in Uncategorized | 3 Comments

A Simple Closure To Handle Try/Catch Around Transactions

(Updated: I moved the begin transaction outside of the try as Chad suggested in the comments.) If you’re like me, you’re lazy and hate putting try/catch around your transaction handling in your code. It has to be there, but it’s … Continue reading 

Posted in Uncategorized | 21 Comments

Mapping Timestamp Data Using NHibernate’s ICompositeUserType

In my previous post, I took some string data and mapped it directly to a boolean property on an entity. That was pretty simple, but I wanted to try it out on a little more complex object.. In our projects, … Continue reading 

Posted in Uncategorized | 1 Comment

Mapping Strings to Booleans Using NHibernate’s IUserType

Update: I failed to realized that the functionality of converting “Y” or “N” to a boolean is already built into NHibernate by doing type=”YesNo” (see comments). I’ll leave this post up just for the academics of creating a IUserType. Go … Continue reading 

Posted in Uncategorized | 9 Comments

PTOM: The Interface Segregation Principle

In following suite with the The Los Techies Pablo’s Topic of the Month – March: SOLID Principles, I chose to write a little about the The Interface Segregation Principle (ISP). As Chad pointed out with LSP, the ISP is also … Continue reading 

Posted in PTOM | 6 Comments