#235 JBossQL Limit/Offset support

JBossCMP (36)

Support has been added for restricting the amount of
data fetched from a JDBC database.

JBossQL now supports optional OFFSET and LIMIT
parameters supplied at the end of a query. An example
would be

SELECT OBJECT(o) FROM Order o WHERE o.status = ?1 ORDER
BY o.orderDate OFFSET ?2 LIMIT ?3

This works by discarding rows until <offset> rows have
been fetched and then returning immedately once another
<limit> rows have been fetched. This simple mechanism
is intended to preserve portability across database
vendors. Other approaches including scrollable cursors
or database-specific syntax may be considered later.

Currently the parameters passed to LIMIT and OFFSET
must be int values (or Integer for DynamicQL) as in the

Collection findAllOrders(String status, int offset, int
limit) throws FinderException;


  • Rod Burgett

    Rod Burgett - 2003-02-06

    Logged In: YES

    Im getting a compile error in the test suite that I believe is
    related to this change:

    ...CompleteUnitTestCase.java:18: cannot resolve symbol
    symbol : class LimitOffsetTest
    location: ...CompleteUnitTestCase
    testSuite.addTestSuite( LmiitOffsetTest.class);

    Maybe there is a new class that's not checked in?

  • Jeremy Boynes

    Jeremy Boynes - 2003-02-06

    Logged In: YES

    Sorry, my bad. Unfortunately SF CVS appears to be having
    issues right now. I will commit this as soon as I can.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks