You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (JIRA)" <ji...@apache.org> on 2013/08/04 20:59:49 UTC

[jira] [Closed] (CAY-1834) Exception: ToManyList cannot be cast to DataObject

     [ https://issues.apache.org/jira/browse/CAY-1834?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik closed CAY-1834.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 3.2M2

Fixed as a result of CAY-1861 fix. I committed the unit tests demoing the problem. They now all pass.
                
> Exception: ToManyList cannot be cast to DataObject
> --------------------------------------------------
>
>                 Key: CAY-1834
>                 URL: https://issues.apache.org/jira/browse/CAY-1834
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 3.1B2
>            Reporter: Jurgen Doll
>             Fix For: 3.2M2
>
>         Attachments: 0001-xx.patch, VisionsMap.map.xml
>
>
> I have an entity called Activity with a M-N relationship to ActivityResults (No middle or linking table).
> The relationship getResults() returns a MAP<name,ActivityResults>, but the exception also occurs when using a List<ActivityResults>.
> I have found that selecting "To Many" on the dbEntity backing the child class (ActivityResults) produces the exception. While switching "To Many" off removes the exception and commits succesfully.
> If an existing ActivityResult is modified and the Activity is then committed the updates related to the ActivityResults are "successful", but rolled back as an exception is thrown when post-processing Activity:
> java.lang.ClassCastException: org.apache.cayenne.access.ToManyList cannot
> be cast to org.apache.cayenne.DataObject
> 	at
> org.apache.cayenne.reflect.generic.DataObjectBaseProperty.toDataObject(DataObjectBaseProperty.java:97)
> 	at
> org.apache.cayenne.reflect.generic.DataObjectBaseProperty.readPropertyDirectly(DataObjectBaseProperty.java:70)
> 	at
> org.apache.cayenne.reflect.generic.DataObjectToManyProperty.isFault(DataObjectToManyProperty.java:106)
> 	at
> org.apache.cayenne.access.DataDomainSyncBucket.postprocess(DataDomainSyncBucket.java:257)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira