Hibernate version: 1.2 GA
Name and version of the database you are using: MS SQL 2005
I need the following: I have a Criteria query which is built to provide records (dinamically created). I know an Id. Now I need to know row number of the record with such Id in terms of given Criteria query. Something like that:
'WITH query AS (SELECT ROW_NUMBER() OVER (ORDER BY CURRENT_TIMESTAMP) as rowNumber, this_.Id as Id26_0_, this_.Name as Name26_0_, this_.Description as Descript3_26_0_, this_.Discontinued as Disconti4_26_0_ FROM Observation this_ WHERE ... ORDER BY ...) SELECT rowNumber FROM query WHERE Id26_0_ = @id',N'@id int',@id=...
Is there any way to do it using NHibernate or at least possibility to catch generated SQL query and patch it by myself?
|