Hi
I'm a newbie to NHibernate so apologise in advance if this problem is due to my ignorance.
I get
Quote:
NHibernate.MappingException: No persisters for: MIPSDataEntry.User
when tring to save my object.
I am using a MySql Database and have remembered to rebuild the solution everytime I change the User.hbm.xml file which is an Embedded Resource.
It might be my sql to build the database???
Code:
CREATE TABLE users (
id INT(32) NOT NULL AUTO_INCREMENT,
logonID VARCHAR(20) NOT NULL DEFAULT '0',
name VARCHAR(40) DEFAULT NULL,
emailAddress VARCHAR(40) DEFAULT NULL,
lastLogon DATETIME DEFAULT NULL,
PRIMARY KEY (id)
)
TYPE=InnoDB
;
the User.hbm.xml file:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="MIPSDataEntry.User, MIPSDataEntry" table="users">
<id name="Id" column="id" type="Int32">
<generator class="identity" />
</id>
<property name="LogonId" column= "logonId" type="String" length="20"/>
<property name="Name" column= "name" type="String" length="40"/>
<property name="EmailAddress" column= "emailAddress" type="String" length="40"/>
<property name="LastLogon" column= "lastLogon" type="DateTime"/>
</class>
</hibernate-mapping>
the User class:
Code:
using System;
namespace MIPSDataEntry
{
public class User
{
private Int32 id;
private String logonID;
private String name;
private String emailAddress;
private DateTime lastLogon;
public User()
{
//
// TODO: Add constructor logic here
//
}
public Int32 Id
{
get { return id; }
set { id = value; }
}
public string LogonId
{
get { return logonID; }
set { logonID = value; }
}
public string Name
{
get { return name; }
set { name = value; }
}
public string EmailAddress
{
get { return emailAddress; }
set { emailAddress = value; }
}
public DateTime LastLogon
{
get { return lastLogon; }
set { lastLogon = value; }
}
}
}
Once again, sorry if I'm being silly and Thanks in advance