Another way that may be better or worse depending on what you are doing: get a list of all the primary keys
(maybe cache the list) and use criteria.addIn(chunkOList) to get the actual page of rows when you need them. this method is good for places where data staleness is not a big problem (if you cache) and where paging is apt to be done often.. you'll need to use sort criteria in both places though.. so if you need sorting the first query cant be JUST for the key... ----- Original Message ----- From: "Daniel Rall" <[EMAIL PROTECTED]> To: "Turbine Users List" <[EMAIL PROTECTED]> Sent: Friday, November 02, 2001 3:37 PM Subject: Re: Pagination in Portlets > "Hugh Brien" <[EMAIL PROTECTED]> writes: > > > Does anyone have a suggestion for doing pagination with Velocity > > templates. For example I have 200 items and I want to display them 20 > > at a time > > o Determine how many items you want to display per page (I call this a > window) > > o Determine how many total items you have > > o Get only the items that you want (with an RDBMS, this usually > requires that you get all the items up to the end of your window), > determined by a window start parameter > > o Iterate items in your window and show to user > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
