Note that you'll need to override the SqlTypes() property. This tells NHibernate the type of the database column. So in the following example, as the table column is probably a char(1), we use GetString(1).

ActiveWriter users.

If you use ActiveWriter to generate your classes and hbm.xml mapping files, please be aware that it is currently unable to resolve your custom user type. Hopefully this will be resolved in future releases.

The workaround for now is to generate with ActiveWriter, then hand-edit the appropriate hbm and code files. Just remember if you regenerate, you'll have to reapply your edits!

Hrmm.. Interesting - how then my nHibernate mapping works that maps "Enum.One, Enum.Two, Enum.Three" to "J,U,T" single characters in the DB? Just take a closer look at EnumStringType - it works. This is for anyone who may stumble upon this article.