Serializing EObject using Object handle [message #654864] |
Thu, 17 February 2011 08:29  |
Eclipse User |
|
|
|
Hi,
In my model I have an object with a reference to an EJavaObject. During run time I sometimes populate this reference with a raw type, or String and sometimes with an EObject - EList or other model generated object.
EMF serialization cannot handle both EObject and Object. Meaning, since the reference type is Object it will attempt to serialize everything using Java serialization, rather than using EMF serialization when possible.
Is there a way around this?
The reason I used EJavaObject and not EObject is again, because I sometimes want the ref to point to a raw type.
Thanks,
Ariel
|
|
|
Re: Serializing EObject using Object handle [message #655640 is a reply to message #654864] |
Tue, 22 February 2011 01:13  |
Eclipse User |
|
|
|
Ariel,
Comments below.
Ariel wrote:
> Hi,
> In my model I have an object with a reference to an EJavaObject.
> During run time I sometimes populate this reference with a raw type,
> or String and sometimes with an EObject - EList or other model
> generated object.
That sounds problematic, given that EList and EObject don't generally
support java.io.Serializeable.
>
> EMF serialization cannot handle both EObject and Object. Meaning,
> since the reference type is Object it will attempt to serialize
> everything using Java serialization, rather than using EMF
> serialization when possible.
> Is there a way around this?
There's a bugzilla open about implementing java.io.Serializeable, but
it's not complete yet.
>
> The reason I used EJavaObject and not EObject is again, because I
> sometimes want the ref to point to a raw type.
You could look at how the Change model deals with this, i.e., by having
both an EReference and an EAttribute for the value...
>
>
> Thanks,
> Ariel
|
|
|
Powered by
FUDForum. Page generated in 0.06318 seconds