Pagination Method via API
ReActiveAndroid Version: latest
Bug or Feature Request: Access to method of pulling data from DB as Pagination
Description: Another great feature I would like to see is access to API method of basic Pagination fetching; User can, via code, pull List via pagination:
- pass Table.class
- pass limit params
- pass order by params
- pass column to order by params
- pass first id & last id to BETWEEN or;
- pass last id to perform
where("id > ?", lastId)
public List<> fetchPagination(Long firstId, Long lastId, int limit, String orderBy, db.class myModelClass) {
List<myModelClass> result = new ArrayList<myModelClass>();
String defaultSortBy = "DESC";
if(sortBy !=null){
defaultSortBy = sortBy;
}
List<myModelClass> myModelClassList = Select.from(myModelClass.class).where("id > ?", lastId)
.orderBy("id " + defaultSortBy)
.limit(limit)
.fetch();
result = myModelClassList ;
return result;
}
I use the above internally to do this, however would be great if was accessible via API within the library.