views:

188

answers:

1

Hi,

I use CTE to handle paging of data currently, can criteria queries handle CTE?

+1  A: 

IIRC, nhibernate uses a CTE when paging on 2005+, so a query which is paged will result in a CTE using query for the paging. This is logical, as there's no other way of doing paging on sqlserver 2005/2008 unless you want to use temptables. (no, rownumber tricks and the like don't work in all cases, o/r mappers need to work with paging systems which work always)

Frans Bouma