Lazy loading for NHibernate with Ignore.NotFound

牧云@^-^@ 提交于 2019-12-04 06:47:35

When you specify the .NotFound().Ignore() this forces the entity to be eagerly loaded and cannot be overriden with the .LazyLoad(). NHibernate does this because it has to be sure that relationship exists or doesn't exist since you are not relying on the database to enforce this.

My suggestion would be to either catch the ObjectNotFoundException or to fix your data such that you don't have these inconsistencies.

Here's an article about this: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2753

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!