setMaxResults(10); here denotes how may rows you would like to handle at a
time. Usually this is harcoded, got nothing to do with number of rows in table
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124859#4124859
Reply to the post :
http://www.jboss.com/i
ok i get the part of perhaps saying:
for (int i = 0; i < maxSize; i = i+ 10){
|
|q.setFirstResult(i);
|q.setMaxResults(10);
| }
but how do i find out the max rows ? do i need to do a count statement before
that ?
View the original post :
http://www.jboss.com/index.html?module=
Yours is a typical use-case for paging:
http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html
setFirstResults:
http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html#setFirstResult(int)
setMaxResults:
http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html#s