Last active
December 24, 2015 22:29
-
-
Save mverzilli/6873028 to your computer and use it in GitHub Desktop.
Limit number of results shown in "MyReportsView"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AllReportsByTimestampDesc extends UnicefGisView { | |
... | |
... | |
... | |
public List<Map<String, Object>> query() { | |
view.updateIndex(); | |
CBLQueryOptions options = new CBLQueryOptions(); | |
options.setDescending(true); | |
CBLStatus status = new CBLStatus(); | |
//En lugar de retornar el resultado de la query como viene, | |
//recortá la lista para devolver las primeras N posiciones | |
//(supongo que con N=30 no complicamos el uso | |
//y la memoria debería bancársela de sobra) | |
return view.queryWithOptions(options, status); | |
} | |
... | |
... | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment