NHibernate 1.0.5000.0
dbe: PostgreSQL
language: c#
Let's assume i've two classes:
user and
address.
In user
user.hbm.xml mapping file i add below to make connection between classes
(1)
Code:
<set name="userAddresses">
<key column="parent_id"/>
<one-to-many class="address"/>
</set>
Now every time code reaches :
Code:
cfg.AddAssembly("myAssembly");
my app. throws NHibernate.MappingException which i do not understand:
Code:
NHibernate.MappingException: associated class not found: hydrosoft.address ---> System.TypeLoadException: Nie można załadować typu address z zestawu NHibernate, Version=1.0.1.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc.\r\n at System.Type.GetType(String typeName, Boolean throwOnError)\r\n at NHibernate.Util.ReflectHelper.ClassForName(String name)\r\n at NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)\r\n --- Koniec śladu stosu wyjątków wewnętrznych ---\r\n at NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)\r\n at NHibernate.Cfg.Binder.ClassForNameChecked(String name, Mappings mappings, String errorMessage)\r\n at NHibernate.Cfg.Binder.BindOneToMany(XmlNode node, OneToMany model, Mappings mappings)\r\n at NHibernate.Cfg.Binder.BindCollection(XmlNode node, Collection model, String className, String path, Mappings mappings)\r\n at NHibernate.Cfg.CollectionTypeSet.Create(XmlNode node, String prefix, String path, PersistentClass owner, Mappings mappings)\r\n at NHibernate.Cfg.Binder.PropertiesFromXML(XmlNode node, PersistentClass model, Mappings mappings)\r\n at NHibernate.Cfg.Binder.BindRootClass(XmlNode node, RootClass model, Mappings mappings)\r\n at NHibernate.Cfg.Binder.BindRoot(XmlDocument doc, Mappings model)\r\n at NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc)\r\n at NHibernate.Cfg.Configuration.AddXmlReader(XmlTextReader hbmReader)\r\n at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream)\r\n at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly, Boolean skipOrdering)\r\n at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly)\r\n at NHibernate.Cfg.Configuration.AddAssembly(String assemblyName)\r\n at ...
I don't know why it doesn't see the
address class beacause i can use it (the address class) if i delete
(1) code from
user.hbm.xml.
Without the
(1) code pass the
Code:
cfg.AddAssembly("myAssembly");
and i can add/modify/delete users and addresses easily.
Do you have any idea why it throws the exception ?