开发者

NHibernate Query

Is it possible to get NHibernate to generate a query similar to the following with HQL or Criter开发者_运维知识库ia API?

select
    *
from (
    select
       row_number() over ( partition by Column1 order by Column2 ) as RowNumber,
       T.*
    from
        MyTable T
)
where
    RowNumber = 1

I can get it to execute the inner select using the formula attribute, but I can't figure out a way to write a HQL or Criteria query that lets me wrap the inner select in the outer one.


NHibernate 3 has the Linq to NHibernate provider integrated, so you can write queries for paging like:

Session.Query<Customer>().Skip(10).Take(10).ToList();

This should help.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜