cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hugi Thordarson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAY-2244) Using iterate() with ColumnSelect causes a ClassCastException
Date Wed, 22 Feb 2017 11:11:44 GMT

    [ 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)

Mime
View raw message