NHibernate部分错误

1、Found  Two representations of same collection

解决:将包含该对象的主档内的相应集合对象设置为null

2、identifierof an instance of。。

解决:清除缓存后再对主档的Sq进行编辑

3、object refences an unsaved transient instance - save this .....

原因:可能是因为在<mang-to-one>中配置了not-found="ignore"属性,而引发新增时,外联表对象不属于持久化对象

解决:将主档所对应的外联表对象设置为null

4、Unexpected row count:0; expetced: 1

原因:主档的外联表数据被删除而出现的代理错误

解决:在<mang-to-one>中配置not-found="ignore"属性,可以是外联表数据被删除时返回Null

原文地址:https://www.cnblogs.com/ahl5esoft/p/2118784.html