Somehow NHibernate doesn't recognise the class Persoon even though I have clearly mapped it. Any ideas?
NHibernate version:
1.0.2.0
Mapping documents:
Persoon.hbm.xml
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"
namespace="Symtech.Verzuiminzicht.BO" assembly="Symtech.Verzuiminzicht.BO">
<class name="Persoon" table="Persoon">
<id name="ID" type="Int32" access="nosetter">
<column name="ID" not-null="true"/>
<generator class="native" />
</id>
<property name="Achternaam" type="String" column="Achternaam" not-null="true"/>
<joined-subclass name="Gebruiker" table="Gebruiker">
<key column="PersoonID"/>
<property name="Naam" type="String" column="Naam" not-null="true"/>
<property name="Wachtwoord" type="String" column="Wachtwoord" not-null="true"/>
<property name="Email" type="String" column="Email" not-null="true"/>
<bag name="Groep" table="Gebruiker_Groep" cascade="all">
<key column="GebruikerID"/>
<many-to-many column="GroepID" class="Groep"/>
</bag>
</joined-subclass>
</class>
</hibernate-mapping>
Groep.hbm.xml
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"
namespace="Symtech.Verzuiminzicht.BO" assembly="Symtech.Verzuiminzicht.BO">
<class name="Groep" table="Groep">
<id name="ID" type="Int32" access="nosetter">
<column name="ID" not-null="true"/>
<generator class="native" />
</id>
<property name="Naam" type="String" column="Naam" not-null="true"/>
<bag name="Personen" table="Gebruiker_Groep" cascade="all">
<key column="GroepID"/>
<many-to-many column="GebruikerID" class="Persoon"/>
</bag>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:Code:
NHibernate.MappingException was unhandled by user code
Message="An association from the table Gebruiker_Groep refers to an unmapped class: Persoon"
Source="NHibernate"
StackTrace:
at NHibernate.Cfg.Configuration.SecondPassCompileForeignKeys(Table table, ISet done)
at NHibernate.Cfg.Configuration.SecondPassCompile()
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at Symtech.Verzuiminzicht.DA.NHibernateHttpModule.CreateSessionFactory() in D:\projecten\verzuiminzicht\VI_Business\Symtech.Verzuiminzicht.Factories\NHibernateHttpModule.cs:line 84
at Symtech.Verzuiminzicht.DA.NHibernateHttpModule.get_CurrentFactory() in D:\projecten\verzuiminzicht\VI_Business\Symtech.Verzuiminzicht.Factories\NHibernateHttpModule.cs:line 125
at Symtech.Verzuiminzicht.DA.NHibernateHttpModule.CreateSession() in D:\projecten\verzuiminzicht\VI_Business\Symtech.Verzuiminzicht.Factories\NHibernateHttpModule.cs:line 139
at Symtech.Verzuiminzicht.DA.NHibernateHttpModule.get_CurrentSession() in D:\projecten\verzuiminzicht\VI_Business\Symtech.Verzuiminzicht.Factories\NHibernateHttpModule.cs:line 186
at Symtech.Verzuiminzicht.DA.GebruikerFactory.Save(Gebruiker gebr) in D:\projecten\verzuiminzicht\VI_Business\Symtech.Verzuiminzicht.Factories\GebruikerFactory.cs:line 13
at Default2.butOpslaan_Click(Object sender, EventArgs e) in d:\projecten\verzuiminzicht\website\Install.aspx.cs:line 77
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)