小弟请问一个nhibernate的问题
在插入数据库时出现了以下问题:
“未处理的“NHibernate.MappingException”类型的异常出现在 nhibernate.dll 中。
其他信息: Unknown entity class: HelloNHibernate.Message”
查询时也什么也没查出来。
我是用Message.hbm.xml来映射Message对象到messages表的:
<?xml version= "1.0 " encoding= "utf-8 " ?>
<hibernate-mapping xmlns= "urn:nhibernate-mapping-2.0 ">
<class name= "HelloNHibernate.Message, HelloNHibernate " table= "messages ">
<id name= "Id " column= "MsgId " type= "Int32 ">
<generator class= "identity " />
</id>
<property name= "Text " type= "String " length= "200 "/>
</class>
</hibernate-mapping>
是什么问题呢??
------解决方案-------------------- <id name= "Id " column= "ID " type= "Int32 " unsaved-value= "0 ">
<generator class= "native "/>
</id>