cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <>
Subject [jira] [Closed] (CAY-1834) Exception: ToManyList cannot be cast to DataObject
Date Sun, 04 Aug 2013 18:59:49 GMT


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:
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 3.1B2
>            Reporter: Jurgen Doll
>             Fix For: 3.2M2
>         Attachments: 0001-xx.patch,
> 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(
> 	at
> org.apache.cayenne.reflect.generic.DataObjectBaseProperty.readPropertyDirectly(
> 	at
> org.apache.cayenne.reflect.generic.DataObjectToManyProperty.isFault(
> 	at
> org.apache.cayenne.access.DataDomainSyncBucket.postprocess(

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:

View raw message