Mantis - Resin
Viewing Issue Advanced Details
2777 minor always 07-09-08 09:15 07-14-08 11:22
ferg  
ferg  
normal  
closed 3.2.0  
fixed  
none    
none 3.2.0  
0002777: Amber setMaxResults issue
(rep by Riccardo Cohen)

I checked on 07/07 snapshot and the behaviour is conform now.
But there is still a bug in the couple setFirstResult() and setMaxResults().

I have a small sample where I can select first item and count. The count is set to 20.
When I set first = 0 I have 25 items returned. Same until 5.
When I set first = 6, I have only 19 results
When I set first = 10, I have only 15 results
When I set first = 22, I have only 3 results
for all those, the sql select ends by LIMIT 25

Now if I set first=25, the the select is correct : LIMIT 25, 20 and I really have 20 items. Same for higher values.

No emergency but just for info. Thanks.


ps: the code is

      javax.persistence.Query hqr=m_manager.createQuery("select h from Adluser h order by h.id");
      log.info("start="+numstart+" cnt="+numcnt);
      hqr.setFirstResult(numstart);
      hqr.setMaxResults(numcnt);
      ret=(List<Adluser>)hqr.getResultList();



Notes
(0003272)
ferg   
07-14-08 11:22   
jpa/1433