Query contracts. NHibernate persistence and tests.