If you are using the query with max-results defined, then you must to extend 
the EntityQuery class and override the following methods as follows:




  | @Override
  |     @Transactional
  |     public long getLastFirstResult() {
  | 
  |         long page = (getResultCount() / getMaxResults()) * getMaxResults();
  |         if (page >= getResultCount())
  |             return page - getMaxResults();
  |         else
  |             return page;
  |     }
  | 
  |     @Override
  |     public boolean isNextExists() {
  |         return getResultList() != null &&
  |                 getResultCount() > (getFirstResult() != null ? 
getFirstResult() : 0) + getMaxResults();
  |     }
  | 
  | 

Looks like the above methods in the Query class does not take care about a 
paged result (or whatever I can't see). So, I made the above changes and all 
works fine.

HTH.

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4044147
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to