nhibernate 5 之后的不同查询(使用 oracle)
Different query after nhibernate 5 (using oracle)
从 4.1 升级到 5.2 后,nhibernate 创建了一个有点不同的查询,在不受欢迎的地方放置了一个 "OR"。
4.1
...,
...,
(select cast(count(guia5_.ID) as NUMBER(10, 0))
from SAM_GUIA guia5_
where guia5_.PEGID = peg1_.ID <<<<<<<<<<<<<<<
) as col_41_0_,
5.x
...,
...,
(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(),
关于映射的更多信息:
- c.PegId: 整数?
- b.Id: 整数
使用 NHibernate 5.2.6 和 Fluent 2.1.2。
为什么版本 5 转换为不同的 SQL 语句?
从 4.1 升级到 5.2 后,nhibernate 创建了一个有点不同的查询,在不受欢迎的地方放置了一个 "OR"。
4.1
...,
...,
(select cast(count(guia5_.ID) as NUMBER(10, 0))
from SAM_GUIA guia5_
where guia5_.PEGID = peg1_.ID <<<<<<<<<<<<<<<
) as col_41_0_,
5.x
...,
...,
(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(),
关于映射的更多信息:
- c.PegId: 整数?
- b.Id: 整数
使用 NHibernate 5.2.6 和 Fluent 2.1.2。
为什么版本 5 转换为不同的 SQL 语句?