-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to find row number for single row in other query result?
PostPosted: Wed Dec 12, 2007 6:56 am 
Newbie

Joined: Fri Jul 07, 2006 9:26 am
Posts: 5
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.