Nikita Timofeev created CAY-2812:
------------------------------------

             Summary: 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
             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)

Reply via email to