【发布时间】:2011-02-04 06:09:41
【问题描述】:
当查询一个基类时,NHibernate 将为每个基类的子类创建一个左外连接。即使查询仅针对基础中的属性并且在这些属性上设置了投影,也会发生这种情况。
例子:
SELECT this_.Id as y0_, this_.Name as y1_ FROM AnimalBase this_
left outer join Dog this_1_ on this_.Id=this_1_.AnimalBaseFK
left outer join Cat this_2_ on this_.Id=this_2_.AnimalBaseFK
WHERE lower(this_.Name) like @p0;@p0 = '%rover%'
我的问题是我应该如何改变这个默认行为?
谢谢
编辑:
看这里:
【问题讨论】:
标签: nhibernate inheritance criteria