• Post Reply Bookmark Topic Watch Topic
  • New Topic

setFirstResult and setMaxResults for createSQLQuery

 
Jehan Jaleel
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I want to replace some code which was using the Hibernate Criteria API with a SQL query. So instead of calling...



I now have...



The problem is that the old code also calls Criteria's setFirstResult and setMaxResults methods. Are there any equivalents for these when using createSQLQuery?

Thanks in advance for any help,
Jehan
 
Jehan Jaleel
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I found that the Hibernate Query objects does have these methods, but for some reason when I used them my ResultSet went from being composed of Integers to being composed or Object arrays. Anyone know why this happened? Weird.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!