Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.1M2
-
None
Description
SelectQueryMetadata.resolve:
Must include the fetchOffset property from query.
So we can cache correctly pagination queries.
for example without this property:
SelectQuery query = new SelectQuery(Example.class);
query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
query.setFetchOffset(0);
query.setFetchLimit(10);
ctx.performQuery(query);
// Returns the first ten elements, cached under key "Example/10"
Select query2 = new SelectQuery(Example.class);
query2.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
query2.setFetchOffset(10);
query2.setFetchLimit(10);
ctx.performQuery(query2);
// Returns the first ten elements from cache, this is not correct it must return the next block of elements.
// Because the cache key is again "Example/10"