Skip to main content



      Home
Home » Modeling » EMF » Serializing EObject using Object handle(EMF Serialization)
Serializing EObject using Object handle [message #654864] Thu, 17 February 2011 08:29 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:How to append an EObject to an AnyType containment reference.
Next Topic:EMF support for block
Goto Forum:
  


Current Time: Wed Jul 23 13:47:30 EDT 2025

Powered by FUDForum. Page generated in 0.06318 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top