If anyone else has this problem, the trick is to decorate your classes with the
HibernateMapping attribute and serialize each class individually using the HbmSerializer like so :
Code:
NHibernate.Cfg.Configuration cfg = new NHibernate.Cfg.Configuration();
Assembly a = Assembly.GetExecutingAssembly();
foreach (Type t in a.GetTypes())
{
if (t.IsSubclassOf(typeof(YourBaseClass)))
{
System.IO.MemoryStream stream = new System.IO.MemoryStream();
NHibernate.Mapping.Attributes.HbmSerializer.Default.Serialize(stream, t);
stream.Position = 0;
cfg.AddInputStream(stream);
stream.Close();
}
}