我为2000定制了一个方言。
public class MsSql2000Dialect : NHibernate.Dialect.MsSql2000Dialect
{
public override bool SupportsLimit
{
get { return true; }
}
/// <summary>
/// Does this Dialect support an offset?
///
/// </summary>
public override bool SupportsLimitOffset
{
get
{
return true;
}
}
}
但我发现它会生成愚蠢的查询。
select top [pageIndex]*pageSize from [table] ........
如何配置或编写代码,让查询为:
select top [pageSize] from [table] ....
where ..
and Id not in(select top [paggeIndex]*pageSize Id from ............)