这个NHibernate查询似乎使用整数数据类型作为常量参数,导致错误的结果:
datum
答案 0 :(得分:0)
根据SQL-server 2008方言在My Machine上工作,根据NHibernate profiler在NHibernate 4.0.4.4000上生成以下SQL:
select fooentity0_.Id as Id3_,
fooentity0_.IntProp as IntProp3_,
fooentity0_.AnotherIntProp as AnotherI3_3_
from [FooEntity] fooentity0_
where cast(fooentity0_.IntProp as FLOAT(53)) < 1.5 /* @p0 */ * cast(fooentity0_.AnotherIntProp as FLOAT(53))
所以我猜这是一个特定于方言的错误,你使用哪种方言?