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

Function Criteria's setFirstResult(int a)

 
Anand Bhatt
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How can the
setFirstResult(int a) method of Criteria
in hibernate
affect the result of the query. I am running the program using this ,but did not able to get the exact function of this method
 
Anand Bhatt
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got the description:
f you want to skip the first element, you should to use
criteria.setFirstResult(1);
And in the same way you can skip the first N elements.

In other words - you are saying how many elements you want to be skipped and not returned to you from the result.

Keep in mind that the counting starts from 0 so the first element is 0

Hope this makes it a bit clearer.

For who have also have some doubt like me.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic