Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Serializing EObject using Object handle(EMF Serialization)
Serializing EObject using Object handle [message #654864] Thu, 17 February 2011 13:29 Go to next message
Ariel  is currently offline Ariel Friend
Messages: 1
Registered: February 2011
Junior Member
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 06:13 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How to append an EObject to an AnyType containment reference.
Next Topic:EMF support for block
Goto Forum:
  


Current Time: Fri Apr 26 01:27:26 GMT 2024

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

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

Back to the top