cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@xsinet.co.za
Subject Re: ToManyList cannot be cast to DataObject
Date Mon, 10 Jun 2013 18:19:32 GMT
I also tried using a List instead of the Map and got the same result.

After rearranging things a bit 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.

Unfortunately the rearrangements I've made now prevents me from commiting
a new record, I get a different exception. (I'll post a new thread for
that.)

Andrus I opened Jira CAY-1834 as requested.


> Not using Map relationships myself that much, but looking at the sources,
> this might be a bug. Could you open a Jira please (if possible, including
> the DataMap XML file)?
>
> Andrus
>
> On Jun 6, 2013, at 7:22 PM, dollj@xsinet.co.za wrote:
>
>> Hi All
>>
>> I need some help in resolving an error using Cayenne v.3.1B2 Feb 07 2013
>> 18:36:43
>>
>> I have an entity called Activity with a M-N relationship to
>> ActivityResults.
>> The relationship getResults() returns a MAP<name,ActivityResults>.
>>
>> New Activities with related ActivityResults commit (and updates in the
>> same session) without error.
>>
>> However if a previously existing ActivityResult is modified and the
>> Activity is then committed the following error is produced:
>>
>> 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)
>>
>>
>> Any help resolving this would be appreciated.
>> Thanks, Jurgen
>>
>>
>>
>
>



Mime
View raw message