HI there!
I am developing a little application using Silverlight/WCF & NHibernate. I have several classes wich descend from a class named "Master". This class only contains a property named Id wich will be generated navitely. I have done this in order to avoid having always the same field "id" in every class. My problem is that I don't know how to map it . Actually I have a xml file named "User.hbm.xml", whose code is :
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Save" namespace="Save.Domain">
<class name="User">
<id name="Id">
<generator class="Save.Domain.Master"/>
</id>
<!--
<bag name="LstAccess">
<key column="Id"/>
<one-to-many class="Access"/>
</bag>
<property name="State"/>
<property name="Username"/>
<property name="Password"/>
<many-to-one class="Profile" column="Id" name="UserProfile"/>
-->
</class>
</hibernate-mapping>
I have beel reading nhibernate documentation, but the only way i find to do this is to have a unique file ( named "Master.hbm.xml" for instance ) with all the <subclass> tags ( each for every class I have ), but this will create a BIG "Master.hbm.xml" file ...
Any hints, suggestions ?
Regards,
Ivan Frias