Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Why is there an error for * about the data type * not being serializable?
Why is there an error for * about the data type * not being serializable? [message #1727803] Sun, 27 March 2016 19:27 Go to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
Newbie question:

I read the EMF book but it seems I missed something.

Why is there an error for ModelAssembler and MathModelInvokeSequence about the data type MathModel not being serializable, but no error on the data type MathModel that it is not serializable?

How do I fix this?
index.php/fa/25435/0/
  • Attachment: Snap10.png
    (Size: 23.12KB, Downloaded 238 times)


Oxygen 3a
Windows 10
Re: Why is there an error for * about the data type * not being serializable? [message #1727814 is a reply to message #1727803] Mon, 28 March 2016 01:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29545
Registered: July 2009
Senior Member
Paul,

A data type can be used in contexts where it's not required to be EMF
serializeable, e.g., an parameter of an operation or a transient
attribute of an class. So it's only the use of a non-serializeable data
type in a context that requires it to be serializeable (a non-transient
attribute) that is an error.

You can either make the feature transient, or you must make the data
type serializeable, which involves hand implementing the two conversion
methods in the generated factory implementation class.


On 28.03.2016 03:27, Paul Roubekas wrote:
> Newbie question:
>
> I read the EMF book but it seems I missed something.
>
> Why is there an error for ModelAssembler and MathModelInvokeSequence about the data type MathModel not being serializable, but no error on the data type MathModel that it is not serializable?
>
> How do I fix this?
>
Re: Why is there an error for * about the data type * not being serializable? [message #1727838 is a reply to message #1727814] Mon, 28 March 2016 10:39 Go to previous messageGo to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
The attribute must be serializeable.


Quote:
which involves hand implementing the two conversion methods in the generated factory implementation class.



Yes, I remember this from reading the EMF book. My issue is one step sooner. How do you get the ecore editor to allow the factory to be generated? In other words, how do you get the error to go away? How do you tell the editor I will implement the conversion methods?


Oxygen 3a
Windows 10
Re: Why is there an error for * about the data type * not being serializable? [message #1727844 is a reply to message #1727838] Mon, 28 March 2016 11:44 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 29545
Registered: July 2009
Senior Member
Paul,

The factory is always generated. You must change the EDataType's
serializeable attribute to true to make the error go away and then the
factory will have the method stubs you must implement.

On 28.03.2016 18:39, Paul Roubekas wrote:
> The attribute must be serializeable.
>
> Quote:
>> which involves hand implementing the two conversion methods in the
>> generated factory implementation class.
>
>
>
> Yes, I remember this from reading the EMF book. My issue is one step
> sooner. How do you get the ecore editor to allow the factory to be
> generated? In other words, how do you get the error to go away? How do
> you tell the editor I will implement the conversion methods?
Previous Topic:EMF EcoreUtil Scalability issue with filterDescendants
Next Topic:Copy a ecore model branch from one model to another.
Goto Forum:
  


Current Time: Sun Sep 23 02:21:03 GMT 2018

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

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

Back to the top