[
https://issues.apache.org/jira/browse/CAY-2812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Nikita Timofeev closed CAY-2812.
--------------------------------
Resolution: Fixed
This is just a special case of CAY-2814
> ColumnQuery mapper function is not applied in ResultBatchIterator
> -----------------------------------------------------------------
>
> Key: CAY-2812
> URL: https://issues.apache.org/jira/browse/CAY-2812
> Project: Cayenne
> Issue Type: Bug
> Components: Core Library
> Affects Versions: 4.2
> Reporter: Nikita Timofeev
> Assignee: Nikita Timofeev
> Priority: Major
> Fix For: 4.2.1, 5.0.M1
>
>
> {{query.batchIterator()}} call always returns {{Object[]}} disregarding
> mapper set for the {{ColumnQuery}} causing {{ClassCastException}}
> Query example:
> {code:java}
> void select() {
> // actual type of the iterator will be Object[] instead of DTO
> ResultBatchIterator<DTO> it = ObjectSelect.columnQuery(Entity.class,
> Entity.ATTRIBUTE1, Entity.ATTRIBUTE2)
> .map(this::toDto)
> .batchIterator(context, 100);
> }
> DTO toDto(Object[] data) {
> // ...
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)