急Nhibernate 问题

zykj_2000 zykj_2000 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
晕,搞了一个星期 了,连测试的还 没有搞定
出现这个问题
pb.testdal.Db.testusers.Testthisuser : NHibernate.MappingException :
----> System.Xml.Schema.XmlSchemaException : 元素“urn:nhibernate-mapping-2.0:class”
有无效的子元素“urn:nhibernate-mapping-2.0:LogonID”。
应为“urn:nhibernate-mapping-2.0:meta urn:nhibernate-mapping-2.0:jcs-cache urn:nhibernate-mapping-2.0:id urn:nhibernate-mapping-2.0:composite-id”。
file:///L:/testdal/testdal1/bin/Release/users.hbm.xml, (4, 5)处发生了错误。

我的XML文件
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="pb.testdal.Db.users, testdal1" table="users">
<LogonID name="LogonID" column="LogonID" type="String(20)">
<generator class="assigned" />
</LogonID>

<property name="Name" type="String" column="Name(40)"/>
<property name="Password" type="String" column="Password(20)"/>
<property name="EmailAddress" type="String" column="EmailAddress(20)"/>
<property name="LastLogon" type="DateTime" column="LastLogon" />
</class>
</hibernate-mapping>

using System;

namespace pb.testdal.Db
{
public class users
{
public users()
{

}


private System.String _Password;
public System.String Password
{
get { return _Password; }
set { _Password = value; }
}

private System.DateTime _LastLogon;
public System.DateTime LastLogon
{
get { return _LastLogon; }
set { _LastLogon = value; }
}

private System.String _Name;
public System.String Name
{
get { return _Name; }
set { _Name = value; }
}

private System.String _LogonID;
public System.String LogonID
{
get { return _LogonID; }
set { _LogonID = value; }
}

private System.String _EmailAddress;
public System.String EmailAddress
{
get { return _EmailAddress; }
set { _EmailAddress = value; }
}
}
}
...全文
评论 7
收藏 已收藏
分享
返回顶部
zykj_2000
C# 111,129 成员 642,540 内容