[jboss-user] [EJB 3.0] - Re: EntityManager's Native Query & Paging Results

rabbiaqaswar do-not-reply at jboss.com
Thu Jun 19 09:45:00 EDT 2008

I just checked the javadoc of javax.persitence.Query, method setFirstResult and it says:

anonymous wrote : Query setFirstResult(int startPosition)
  |     Set the position of the first result to retrieve.
  |     Parameters:
  |         startPosition - the start position of the first result, numbered from 0 
  |     Returns:
  |         the same query instance 
  |     Throws:
  |         IllegalArgumentException - if argument is negative

So the index must be starting from 0. Even in my query the first result i get when i setFirstResult to 0 is the user id in first row in the table and get the second id when the setFirstResult is set to 1.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159288#4159288

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159288

More information about the jboss-user mailing list