Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » The attribute "xyz" is not transient so it must have a data type that is serializable?!?
The attribute "xyz" is not transient so it must have a data type that is serializable?!? [message #512813] Sun, 07 February 2010 23:31 Go to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
I defined an attribute as EMap<?,?> at which point I got the subject error
message. But also after changing the two arguments to EString (i.e. the type
now reads EMap<EString, EString>) I keep getting that error message. I would
argue, that String ARE serializable. Or are EStrings not?

Michael
Re: The attribute "xyz" is not transient so it must have a data type that is serializable? [message #512937 is a reply to message #512813] Mon, 08 February 2010 11:45 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030304080206030904050300
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Michael,

If you defined a map like, this it will be serialized automatically:

2.29 How do I create a Map in EMF?
< http://wiki.eclipse.org/index.php/EMF/FAQ#How_do_I_create_a_ Map_in_EMF.3F>

But if you define an EDataType, then you're responsible for how to
serialize an instance of that as a whole.


Michael Moser wrote:
> I defined an attribute as EMap<?,?> at which point I got the subject
> error message. But also after changing the two arguments to EString
> (i.e. the type now reads EMap<EString, EString>) I keep getting that
> error message. I would argue, that String ARE serializable. Or are
> EStrings not?
>
> Michael
>

--------------030304080206030904050300
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Michael, <br>
<br>
If you defined a map like, this it will be serialized automatically:<br>
<blockquote><a
href=" http://wiki.eclipse.org/index.php/EMF/FAQ#How_do_I_create_a_ Map_in_EMF.3F"><span
class="tocnumber">2.29</span> <span class="toctext">How do I create a
Map in EMF?</span></a><br>
</blockquote>
But if you define an EDataType, then you're responsible for how to
serialize an instance of that as a whole.<br>
<br>
<br>
Michael Moser wrote:
<blockquote cite="mid:hknihc$f35$1@build.eclipse.org" type="cite">I
defined an attribute as EMap&lt;?,?&gt; at which point I got the
subject error message. But also after changing the two arguments to
EString (i.e. the type now reads EMap&lt;EString, EString&gt;) I keep
getting that error message. I would argue, that String ARE
serializable. Or are EStrings not?
<br>
<br>
Michael
<br>
<br>
</blockquote>
</body>
</html>

--------------030304080206030904050300--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: The attribute "xyz" is not transient so it must have a data type that is serializable? [message #513726 is a reply to message #512937] Wed, 10 February 2010 18:48 Go to previous messageGo to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
I tried to create a map according to the referenced description, but even
though the validation finds not problem and the definition even seems to
make sense (at least to me) the generated code does not even compile...

I attach the .ecore and .genmodel files. Any ideas?

Michael


> "Ed Merks" <Ed.Merks@gmail.com> wrote in message
> news:hkotgd$fus$2@build.eclipse.org...
> Michael,
>
> If you defined a map like, this it will be serialized automatically:
>
> 2.29 How do I create a Map in EMF?
>
> But if you define an EDataType, then you're responsible for how to
> serialize an instance of that as a whole.
>
>
> Michael Moser wrote:
> I defined an attribute as EMap<?,?> at which point I got the subject error
> message. But also after changing the two arguments to EString (i.e. the
> type now reads > EMap<EString, EString>) I keep getting that error
> message. I would argue, that String ARE serializable. Or are EStrings not?
>
> Michael
Re: The attribute "xyz" is not transient so it must have a data type that is serializable? [message #513727 is a reply to message #513726] Wed, 10 February 2010 18:48 Go to previous messageGo to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_001D_01CAAAAF.ED713AE0
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=response
Content-Transfer-Encoding: 7bit

For some reason my attachments didn't make it. Trying again...
Michael

"Michael Moser" <mmo@zurich.ibm.com> wrote in message
news:hkveg6$gah$1@build.eclipse.org...
>I tried to create a map according to the referenced description, but even
>though the validation finds not problem and the definition even seems to
>make sense (at least to me) the generated code does not even compile...
>
> I attach the .ecore and .genmodel files. Any ideas?
>
> Michael

------=_NextPart_000_001D_01CAAAAF.ED713AE0
Content-Type: application/octet-stream;
name="WebReader.ecore"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="WebReader.ecore"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<ecore:EPackage xmi:version=3D"2.0"
xmlns:xmi=3D"http://www.omg.org/XMI" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore=3D"http://www.eclipse.org/emf/2002/Ecore" =
name=3D"WebReader"
nsURI=3D"http://mmo.net/projects/WebReader" nsPrefix=3D"hr">
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"Document">
<eStructuralFeatures xsi:type=3D"ecore:EAttribute" name=3D"uri" =
eType=3D"ecore:EDataType =
http://www.eclipse.org/emf/2002/Ecore#//EString"
defaultValueLiteral=3D""/>
<eStructuralFeatures xsi:type=3D"ecore:EAttribute" =
name=3D"friendlyName" eType=3D"ecore:EDataType =
http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type=3D"ecore:EAttribute" =
name=3D"contentType" eType=3D"ecore:EDataType =
http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type=3D"ecore:EReference" name=3D"children" =
upperBound=3D"-1"
eType=3D"#//Document" containment=3D"true"/>
<eStructuralFeatures xsi:type=3D"ecore:EAttribute" name=3D"links" =
upperBound=3D"-1"
eType=3D"ecore:EDataType =
http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"CookieJar" =
instanceTypeName=3D"EStringToCookieMap">
<eStructuralFeatures xsi:type=3D"ecore:EReference" name=3D"cookies" =
upperBound=3D"-1"
eType=3D"#//EStringToCookieMap" containment=3D"true" =
resolveProxies=3D"false"/>
</eClassifiers>
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"EStringToCookieMap" =
instanceClassName=3D"java.util.Map$Entry">
<eStructuralFeatures xsi:type=3D"ecore:EAttribute" name=3D"key" =
lowerBound=3D"1" eType=3D"ecore:EDataType =
http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type=3D"ecore:EReference" name=3D"value" =
lowerBound=3D"1" eType=3D"#//Cookie"
containment=3D"true"/>
</eClassifiers>
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"Cookie">
<eStructuralFeatures xsi:type=3D"ecore:EAttribute" name=3D"value" =
eType=3D"ecore:EDataType =
http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type=3D"ecore:EAttribute" name=3D"expiry" =
eType=3D"ecore:EDataType =
http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
</eClassifiers>
</ecore:EPackage>

------=_NextPart_000_001D_01CAAAAF.ED713AE0
Content-Type: application/octet-stream;
name="WebReader.genmodel"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="WebReader.genmodel"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<genmodel:GenModel xmi:version=3D"2.0"
xmlns:xmi=3D"http://www.omg.org/XMI" =
xmlns:ecore=3D"http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel=3D"http://www.eclipse.org/emf/2002/GenModel" =
modelDirectory=3D"/WebReaderModel/src"
modelPluginID=3D"WebReaderModel" modelName=3D"WebReader" =
importerID=3D"org.eclipse.emf.importer.ecore"
complianceLevel=3D"6.0" copyrightFields=3D"false">
<foreignModel>WebReader.ecore</foreignModel>
<genPackages prefix=3D"WebReader" disposableProviderFactory=3D"true" =
ecorePackage=3D"WebReader.ecore#/">
<genClasses ecoreClass=3D"WebReader.ecore#//Document">
<genFeatures createChild=3D"false" =
ecoreFeature=3D"ecore:EAttribute WebReader.ecore#//Document/uri"/>
<genFeatures createChild=3D"false" =
ecoreFeature=3D"ecore:EAttribute =
WebReader.ecore#//Document/friendlyName"/>
<genFeatures createChild=3D"false" =
ecoreFeature=3D"ecore:EAttribute =
WebReader.ecore#//Document/contentType"/>
<genFeatures property=3D"None" children=3D"true" =
createChild=3D"true" ecoreFeature=3D"ecore:EReference =
WebReader.ecore#//Document/children"/>
<genFeatures createChild=3D"false" =
ecoreFeature=3D"ecore:EAttribute WebReader.ecore#//Document/links"/>
</genClasses>
<genClasses ecoreClass=3D"WebReader.ecore#//CookieJar">
<genFeatures property=3D"None" children=3D"true" =
createChild=3D"true" ecoreFeature=3D"ecore:EReference =
WebReader.ecore#//CookieJar/cookies"/>
</genClasses>
<genClasses ecoreClass=3D"WebReader.ecore#//StringToCookieMap">
<genFeatures createChild=3D"false" =
ecoreFeature=3D"ecore:EAttribute =
WebReader.ecore#//StringToCookieMap/key"/>
<genFeatures property=3D"None" children=3D"true" =
createChild=3D"true" ecoreFeature=3D"ecore:EReference =
WebReader.ecore#//StringToCookieMap/value"/>
</genClasses>
<genClasses ecoreClass=3D"WebReader.ecore#//Cookie">
<genFeatures createChild=3D"false" =
ecoreFeature=3D"ecore:EAttribute WebReader.ecore#//Cookie/value"/>
<genFeatures createChild=3D"false" =
ecoreFeature=3D"ecore:EAttribute WebReader.ecore#//Cookie/expiry"/>
</genClasses>
</genPackages>
</genmodel:GenModel>

------=_NextPart_000_001D_01CAAAAF.ED713AE0--
Re: The attribute "xyz" is not transient so it must have a data type that is serializable? [message #513729 is a reply to message #513727] Wed, 10 February 2010 23:48 Go to previous message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
I finally got this going - please ignore my previous appends...
M.


"Michael Moser" <mmo@zurich.ibm.com> wrote in message
news:hkveum$ql3$1@build.eclipse.org...
> For some reason my attachments didn't make it. Trying again...
> Michael
>
> "Michael Moser" <mmo@zurich.ibm.com> wrote in message
> news:hkveg6$gah$1@build.eclipse.org...
>>I tried to create a map according to the referenced description, but even
>>though the validation finds not problem and the definition even seems to
>>make sense (at least to me) the generated code does not even compile...
>>
>> I attach the .ecore and .genmodel files. Any ideas?
>>
>> Michael
>
Previous Topic:ViewerFilter and EMF
Next Topic:Race condition in validation service when accessed by multiple threads
Goto Forum:
  


Current Time: Sat Sep 21 02:31:49 GMT 2024

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

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

Back to the top