NHibernate即时SQL用于袋收集的linq标准 [英] NHibernate just-in-time SQL for linq criteria on bag collections

查看:70
本文介绍了NHibernate即时SQL用于袋收集的linq标准的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在NHibernate中,是否可以过滤映射为bag关联的collection属性,以便在发生延迟加载时,将过滤器直接应用到SQL中,而不是先加载整个bag集合,然后对其进行过滤?

In NHibernate is it possible to filter a collection property which is mapped as a bag association such that when the lazy loading occurs the filter is applied directly in the SQL rather than loading the whole bag collection and then filtering it?

F.Y.I-我正在使用xml映射文件.

F.Y.I - I'm using xml mapping files.

推荐答案

是的,如果您在映射中定义了过滤器:

Yes, if you define the filter in the mappings: http://nhibernate.info/doc/nh/en/index.html#filters

这篇关于NHibernate即时SQL用于袋收集的linq标准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆