You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Bryan Lewis <br...@maine.rr.com> on 2007/02/16 20:36:52 UTC

SQLTemplate fetchLimit

Just checking my understanding of something...  Does it make any sense
to call setFetchLimit() on a SQLTemplate?  We're supplying the raw SQL
so I would think we'd have to hand-craft the fetch limit as well, say
with a 'rownum' or 'limit'.



Re: SQLTemplate fetchLimit

Posted by Andrus Adamchik <an...@objectstyle.org>.
On Feb 16, 2007, at 2:36 PM, Bryan Lewis wrote:

> Just checking my understanding of something...  Does it make any sense
> to call setFetchLimit() on a SQLTemplate?  We're supplying the raw SQL
> so I would think we'd have to hand-craft the fetch limit as well, say
> with a 'rownum' or 'limit'.

Really up to you. In this case Cayenne fetch limit will still work  
(i.e. Cayenne will ensure that no more than X rows are read via  
JDBC), but it is definitely more efficient to incorporate this syntax  
in the SQL query to let the DB know and optimize the query accordingly.

Andrus