Template for building a session factory and NHibernate's mapping by code.