-->
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.  [ 3 posts ] 
Author Message
 Post subject: Query.setFirstResult()
PostPosted: Mon Nov 27, 2006 7:02 am 
Newbie

Joined: Thu Oct 06, 2005 9:57 am
Posts: 5
Hello,

How does Hibernate implement the method Query.setFirstResult()?

Please don't get mad, I know this is off-topic. I did ask the same question on a relevant forum but didn't get any answer yet.

I am using MySQL and connecting to it via the ConnecterJ JDBC driver.

Thanks alot.
--
Santosh.


Top
 Profile  
 
 Post subject: Re: Query.setFirstResult()
PostPosted: Mon Nov 27, 2006 12:28 pm 
Newbie

Joined: Fri Jul 30, 2004 5:35 am
Posts: 9
Location: Iceland
It changes how the ResultSet is accessed. If you set it the ResultSet will be scrollable and only rows from the given value accessed.

PS. I found this out by fetching the source code, you should probably try that ;-)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 27, 2006 2:37 pm 
Newbie

Joined: Mon Jan 05, 2004 11:04 am
Posts: 16
Hi,

set the following properties in your hibernate.cfg.xml to true

"hibernate.show_sql"
"hibernate.format_sql"
"hibernate.use_sql_comments"

and
try an example with
Query.setFirstResult()
and
Query.setMaxResults()

and you will see the generated sql.

_________________
_________________
Siegbert

Please don't forget to give credit if/when you get helpful information.


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

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.