Help with IQueryResult and setting limits
I "inherited" some code and in reviewing it, I ended up with a question I was hoping someone could assist me with.
IQueryResult results = getQueryClient().getResolvedQueryResults(query, profile); results.setLimit(queryLimit); int total = validateWorkItemQueryResult(results); while (results.hasNext(null)) { //process the results } The results.setLimit(queryLimit); call is the part that is confusing. It looks like we have already run the query in the line above, so then would setLimit() do anything at that point? But if not, then how would I set the limit for the query before running the query itself? Thanks, Susan |
One answer
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
Looking at the code, effectively there has been a Count done when the getResolvedQyeryResults() call is executed, but no results are actually fetched yet.
the setLimit() sets the fetch size. and the fetch is done on the first next().