You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Hugi Thordarson (JIRA)" <ji...@apache.org> on 2017/02/22 11:11:44 UTC

[jira] [Commented] (CAY-2244) Using iterate() with ColumnSelect causes a ClassCastException

    [ https://issues.apache.org/jira/browse/CAY-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15878012#comment-15878012 ] 

Hugi Thordarson commented on CAY-2244:
--------------------------------------

Thanks for the quick resolution :)

> Using iterate() with ColumnSelect causes a ClassCastException
> -------------------------------------------------------------
>
>                 Key: CAY-2244
>                 URL: https://issues.apache.org/jira/browse/CAY-2244
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 4.0.M5
>            Reporter: Hugi Thordarson
>            Assignee: Nikita Timofeev
>
> iterate() attempts to cast the Object[] to a DataRow
> Example code:
> ----------------
> ObjectSelect
>   .query( User.class )
>   .columns( User.NAME )
>   .iterate( someContext, user -> {} );
> ----------------
> Resulting exception
> ----------------
> Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to org.apache.cayenne.DataRow
> 	at org.apache.cayenne.access.DataContext$3.nextRow(DataContext.java:840)
> 	at org.apache.cayenne.util.ResultIteratorIterator.next(ResultIteratorIterator.java:38)
> 	at org.apache.cayenne.BaseContext.iterate(BaseContext.java:343)
> 	at org.apache.cayenne.query.FluentSelect.iterate(FluentSelect.java:556)
> 	at x.ToMap.main(ToMap.java:14)
> ----------------



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)