Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic