Is there any way to reuse NHibernate components (<component>) in more than one mapping?
For example: an Address class in Employee and Customer classes – The only way to do this which I see now is to copy-paste the Address component mapping from one of the class mappings into another.
Is there any way to reuse NHibernate components (<component>) in more than one mapping?
Share
I haven’t tried this with NHibernate but it worked with another OR Mapper that used XML configuration files. Create the component mapping in it’s own XML file, then in the XML file that uses the component use an XML external entity to reference it. Here’s a snippet from my Company mapping file: