Here are the mappings of the three classes. I removed a few properties which are not really important.
Customer mappings:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"
namespace="Domain_Layer" assembly="DomainLayer">
<class name="Customer" table="Customers" dynamic-update="true" dynamic-insert="true" lazy="true" >
<id name="Id" column="Customer_ID" unsaved-value="0">
<generator class="identity" />
</id>
<property name="Name" column="Name" />
<many-to-one name="ContactData" column="ContactData_ID" cascade ="save-update"/>
</class>
</hibernate-mapping>
ContactData:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"
namespace="Domain_Layer" assembly="DomainLayer">
<class name="ContactData" table="ContactData" dynamic-update="true" lazy="true" dynamic-insert ="true">
<id name="Id" column="ContactData_ID" unsaved-value="0">
<generator class="native" />
</id>
<one-to-one name="TelephoneNo" class="TelephoneNumber" />
</class>
</hibernate-mapping>
TelephoneNumber:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"
namespace="Domain_Layer" assembly="DomainLayer">
<class name="TelephoneNumber" table="TelephoneNumbers" dynamic-update="true">
<id name="Id" column="TelephoneNumber_ID" unsaved-value="0">
<generator class="native" />
</id>
<property name="AreaCode" column="AreaCode" />
<property name="Extension" column="Extension" />
</class>
</hibernate-mapping>
[/quote]
Thnx! :)