NHibernate异常:No persister for的解决办法

我这里是hbm.xml文件出问题了

出现No persister for错误后有如下三种解决办法: 
1》检查hbm.xml文件。 
2》检查cfg.xml文件,看看类的hbm.xml文件名是不是已经写上了。 
3》对于one-to-many(Parent-to-Child)的关系,应该是 
child.setParent(parent),而不是child.setParent(parent.id)

原文参考:http://blog.csdn.net/terryhuang/article/details/1647537

posted @ 2012-08-09 11:06  我思故我在...  阅读(1416)  评论(0编辑  收藏  举报