从4.1升级到5.2后,nhibernate创建的查询略有不同,在不受欢迎的地方放置了“ OR”。
...,
...,
(select cast(count(guia5_.ID) as NUMBER(10, 0))
from SAM_GUIA guia5_
where guia5_.PEGID = peg1_.ID <<<<<<<<<<<<<<<
) as col_41_0_,
...,
...,
(select cast(count(guia5_.ID) as NUMBER(10, 0))
from SAM_GUIA guia5_
where guia5_.PEGID = peg1_.ID <<<<<<<<<<<<<<<
or (guia5_.PEGID is null) <<<<<<<<<<<<<<<
and (peg1_.ID is null) <<<<<<<<<<<<<<<
) as col_41_0_,
与linq有关的查询是:
...,
...,
RecordCount = (from c in repositoryGuia.All()
where c.PegId == b.Id
select c.Id
).Count(),
有关映射的更多信息:
使用NHibernate 5.2.6和Fluent 2.1.2。
为什么版本5转换为其他SQL语句?