Now I am thinking instead of using FluentIterable, I should implement my own 
class (that implements ResultSet) with that skipping and limit logic.
Still, let me know if there is better and more efficient way than this. Thanks!

________________________________________
From: Zen 98052 <[email protected]>
Sent: Wednesday, September 16, 2015 11:19 AM
To: [email protected]
Subject: paging the query results

Any idea on how to do the paging on the results set?

For example in this code:


ResultSet rs = qe.execSelect();


I was thinking to use com.google.common.collect.FluentIterable, so let say I 
have the start offset and rows count values.

To do the paging logic in naive way would be something like:


FluentIterable<QuerySolution> newIterator = FluentIterable.from(rs);

newIterator.skip(startOffset);

newIterator.limit(rowsCount);


Unfortunately the first line doesn't work (the ResultSet type is not type of 
Iterable as expected by FluentIterable).

Let me know the right way of paging the query results.



Thanks,

Z

Reply via email to