i’m fairly new to NHibernate and although I’m finding tons of infos on NHibernate mapping on the web, I am too silly to find this piece of information.
So the problem is, i’ve got the following Model:

this is how I’d like it to look. One clean person that has two Address Properties.
In the database I’d like to persist this in one table. So the Person row would have a ShippingStreetname and a Streetname Column, the one mapped to ShippingAddress.Streetname and the other to Address.StreetName
I found an article on fluent interfaces, but still haven’t figured out how to do this through the XML Configuration.
Thanks in advance!
Update: I found the solution to this by myself. This can be done through the node and works rather straightforward.
To achieve the mapping of Address and ShippingAddress I just had to add the following to the
<component name='Address' class='Address'> <property name='Streetname'></property> <property name='Zip'></property> <property name='City'></property> <property name='Country'></property> </component> <component name='ShippingAddress' class='Address'> <property name='Streetname' column='ShippingStreetname' /> <property name='Zip' column='ShippingZip' /> <property name='City' column='ShippingCity' /> <property name='Country' column='ShippingCountry' /> </component>
Ok. I found the solution myself. The key is the construct in the XML configuration and it works rather nicely.
Here is how it’s done: