I would not waste my time trying to figure out how to bend NHibernate to work with this poorly designed table structure, out of fear (I might encounter this solution in the future), I provide the following ;-) If you can change it, then normalize the database correctly.
I would start by refactoring the design. Create
Company Table[Id, CompanyName EmailAddress EmailAddressHash]
and
ContactDetails[Id, CustomerId, Phone, PhoneHash ]
Create a Many-to-one relationship. Then look at creating NHibernate mapping.
Create the following Mappings.
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="STOE.Bll" assembly="Bll"> <class name="Company" table="CompanyTable" mutable="false"> <id name="Id" column="Id" unsaved-value="0"> <generator class="identity"/> </id> <property name="Name" column="CompanyName" /> <property name="EmailAddress" column="EmailAddress" /> <property name="EmailAddressHash" column="EmailAddressHash" /> <bag name="CompanyContactDetails" lazy="false" table="ContactDetails" inverse="true" cascade="all"> <key column="CustomerId" /> <one-to-many class="STOE.Bll.CompanyContactDetail, Bll" /> </bag> </class> </hibernate-mapping> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="STOE.Bll" assembly="Bll"> <class name="CompanyContactDetail" table="CompanyContactDetail" mutable="false"> <id name="Id" column="Id" unsaved-value="0"> <generator class="identity"/> </id> <property name="Phone" column="Phone" /> <property name="PhoneHash" column="PhoneHash" /> </class> </hibernate-mapping>