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.
精彩评论