persistence@glassfish.java.net

Fix for setFirstResult/setMaxResults issue

From: Michael Bouschen <Michael.Bouschen_at_Sun.COM>
Date: Wed, 15 Mar 2006 17:32:49 +0100

Hi Tom, Hi Gordon,

I looked at the glassfish issue 344 about setFirstResult and setMaxResults:
   https://glassfish.dev.java.net/issues/show_bug.cgi?id=344

I followed the proposal Peter added to the glassfish issue and changed
the code in class DatabaseCall method prepareStatement from
     if (getMaxRows() > 0) {
         statement.setMaxRows(getMaxRows());
     }
to
     if (getMaxRows() > 0) {
         statement.setMaxRows(getFirstResult() + getMaxRows());
     }

This fixes the issue.

I would like to check in the fix, if there are no objections.

Regards Michael