[ https://issues.apache.org/jira/browse/CAY-2817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17784312#comment-17784312 ]
Nikita Timofeev commented on CAY-2817: -------------------------------------- A little clarification on this issue. As mentions it's raised while working on CAY-2814. A {{dataContext.performIteratedQuery(query)}} method is used here just because it bypasses many parts of the stack logic and doesn't go into a cycle, not because we need an iterator here. And that leads to a problem that we can't optimize and refactor this method until this issue is solved. > Pagination flow refactoring needed > ---------------------------------- > > Key: CAY-2817 > URL: https://issues.apache.org/jira/browse/CAY-2817 > Project: Cayenne > Issue Type: Task > Components: Core Library > Affects Versions: 5.0.M1 > Reporter: Ivan Nikitka > Assignee: Nikita Timofeev > Priority: Major > > The current process for pagination uses direct method for gathering data. > Without any checks, validations and convertations. > {code:java} > public class DataContext extends BaseContext{ > ... > public ResultIterator performIteratedQuery(Query query) > }{code} > {code:java} > public class IncrementalFaultList<E> implements List<E>, Serializable { > ... > protected void fillIn(final Query query, List<Object> elementsList) { > elementsList.clear(); > try (ResultIterator<?> it = dataContext.performIteratedQuery(query)) { > while (it.hasNextRow()) { > elementsList.add(it.nextRow()); > } > } > unfetchedObjects = elementsList.size(); > }{code} > After applying [this|https://github.com/apache/cayenne/pull/594/] PR we need > to redirect pagination flow to the > {code:java} > public class DataContext extends BaseContext{ > ... > public <T> ResultIterator<T> iterator(final Select<T> query) > }{code} > -- This message was sent by Atlassian Jira (v8.20.10#820010)