NHibernate Request

Is it possible to force NHibernate to generate a query similar to the following using the HQL or API criteria?

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

I can get him to make an internal selection using the formula attribute, but I cannot find a way to write an HQL or Criteria query that allows me to wrap the internal selection in the external.

+3
source share
1 answer

NHibernate 3 has an integrated Linq to NHibernate provider, so you can write paging requests, for example:

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

This should help.

-1
source

Source: https://habr.com/ru/post/1748336/


All Articles