#
jcuya
Hi
I'm creating my first module edit page, but I get this error:
Kan type Cuyahoga.Modules.Application.Preferences niet laden vanuit assembly Cuyahoga.Modules
Don't know what I'm doing wrong, it's exactly how the articles module works and how it is described in the module development guide.
The tables look like this:
And for example, Preferences.hbm.xml:
And Preferences.cs:
And at least the code in the constructor of ApplicationModule.cs:
When i delete the lines with registerPersistentClass, nothing goes wrong (offcourse the code doesn't work but I get no errors)
I'm creating my first module edit page, but I get this error:
Kan type Cuyahoga.Modules.Application.Preferences niet laden vanuit assembly Cuyahoga.Modules
Don't know what I'm doing wrong, it's exactly how the articles module works and how it is described in the module development guide.
The tables look like this:
+--------------------+ +--------------+
| vmi_preferences | | vmi_template |
+--------------------+ +--------------+
| vprId | /| vteId |
| vprUrl | / | vteTemplate |
| vprTemplate |/ +--------------+
+--------------------+And for example, Preferences.hbm.xml:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Cuyahoga.Modules.Application.Preferences, Cuyahoga.Modules" table="vmi_preferences">
<id name="Id" column="vprId" type="Int32" unsaved-value="-1">
<generator class="native">
<param name="sequence">vmi_preferences_vprId_seq</param>
</generator>
</id>
<property name="Url" column="vprUrl" type="String" length="100" not-null="false" />
<many-to-one name="Template" class="Cuyahoga.Modules.Application.Template, Cuyahoga.Modules" column="vprTemplate" cascade="none" />
</class>
</hibernate-mapping>And Preferences.cs:
using System;
namespace Cuyahoga.Modules.Application {
public class Preferences {
private int _id;
private string _url;
private Template _template;
/* getters and setters */
public Preferences() {
this._id = -1;
}
}
}And at least the code in the constructor of ApplicationModule.cs:
Preferences pref = new Preferences();
SessionFactory sf = SessionFactory.GetInstance();
sf.RegisterPersistentClass(typeof(Cuyahoga.Modules.Application.Preferences));
sf.RegisterPersistentClass(typeof(Cuyahoga.Modules.Application.Template));
base.SessionFactoryRebuilt = sf.Rebuild();When i delete the lines with registerPersistentClass, nothing goes wrong (offcourse the code doesn't work but I get no errors)