-->
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: Count returned rows when using SetFirstResult and SetMaxResu
PostPosted: Wed Sep 13, 2006 5:58 am 
Newbie

Joined: Wed Sep 13, 2006 5:24 am
Posts: 3
I use named query to perform complicated select with inner queries and MSSQL contains (full-text search). It's execution time is quite long.

It's written as named query in xml file
I use

IQuery query = context.Session.GetNamedQuery("QueryName");

query.SetFirstResult(10);
query.SetMaxResults(20);

Has I understood correctly, that NHibernate execute the provided query and map only 10-20 rows to objects? So, obviously, NHibernate does not modify query (it's MSSQL specific).
Is it right? Does NHibernate use some specific technic to get only 10-20 objects?

Can I get the total rows number (not mapped)? Is it possible not to execute the same query with Select count (*)?
I believe what I need is only to get affected rows count. Can it be retrived?


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.