I've been working to try to fix this for a couple of days. I have made a second simpler project to mitigate any assembly namespace issues I might be having, but I still get the same error. This is that simpler project. Everything is in one namespace, one project. I also created a new simple table with one column. Pretty simple. I have tested that it can at least open a session to the db and that is working. All my files are embedded.
I have tried a few options in the main config like those <mapping> tags with no avail. It just comes back and says it cannot find the .xml file
Hibernate version:
2.0.1.4000
Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="HibTest" assembly="HibTest">
<class name="Path" table="nh_test_Path" lazy="false">
<id name="Id" column="Id" type="Int32">
<generator class="native"/>
</id>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
IDictionary dict = factory.GetAllClassMetadata();
int count = dict.Count;
Path p = new Path();
session.Save(p);
Full stack trace of any exception that occurs:
NHibernate.MappingException: Unknown entity class: HibTest.Path
at NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(Type theClass)
at NHibernate.Impl.SessionImpl.GetClassPersister(Type theClass)
at NHibernate.Impl.SessionImpl.GetEntityPersister(Object obj)
at NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
at NHibernate.Event.Default.DefaultSaveEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event)
at NHibernate.Event.Default.DefaultSaveEventListener.PerformSaveOrUpdate(SaveOrUpdateEvent event)
at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event)
at NHibernate.Impl.SessionImpl.FireSave(SaveOrUpdateEvent event)
at NHibernate.Impl.SessionImpl.Save(Object obj)
at HibTest.TestFixture.Test() in Test.cs: line 31
Name and version of the database you are using:
Sql2008
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|