【发布时间】:2011-08-04 00:08:35
【问题描述】:
我有一个命名的 hql 查询,它使用对象构造函数来处理未映射的对象(仅导入)
例如
select distinct new NotMappedResultClass(ah.SomeProp1, ah.SomeProp2)
from SomeMappedClass
where ...
order by ah.SomeProp1
奇怪的是,当我在 NHibernate 中调用 IQuery.List() 时,我最终得到的 NHibernate 行数是 NHibernate 运行的查询的两倍(使用 SqlProfiler 跟踪)。
(如果重要,“where”子句确实涉及一些子查询)。
为什么 NHibernate 会复制从数据库返回的行?
(我使用的是 NHibernate 1.2.1.4000)
【问题讨论】:
标签: nhibernate hql