Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Issue with Enum data type in GMF
Issue with Enum data type in GMF [message #539315] Thu, 10 June 2010 11:39 Go to next message
login is currently offline loginFriend
Messages: 13
Registered: May 2010
Junior Member
I am working with Enum data type in GMF.
I have created a Enum type as follow:

enum DataType {
String;
Integer;
Float;
}
This i have used as a attribute type for a node.

I generated the diagram code .Runned as Eclipse application.
I create a diagram and added Node .I changed the property of the node and saved it. here node is column and enum is the datatype for that column,
Problem is that when i change the Enum datatype other than default it saves in the xml. but when i change the datatype to defualt it doesnt save.

Sad Sad

Here is the sample without default:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns="spectrial" name="">
<relational>
<dimensionTable name="asdfa">
<column name=""/>
</dimensionTable>
<factTable>
<column name="sdsf" caption="" dataType="Integer"/>
</factTable>
</relational>
</schema>

With default datatype "string"

<?xml version="1.0" encoding="UTF-8"?>
<schema xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns="spectrial" name="">
<relational>
<dimensionTable name="asdfa">
<column name=""/>
</dimensionTable>
<factTable>
<column name="sdsf" caption="" />
</factTable>
</relational>
</schema>



Any help would be appreciated.

Thanks in Advance,
login


Re: Issue with Enum data type in GMF [message #539394 is a reply to message #539315] Thu, 10 June 2010 15:25 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33165
Registered: July 2009
Senior Member
That issue has come up a great many times on the EMF newsgroup. The
value of a feature is saved only if eIsSet is true; you can look at the
generated implementation and see that this will be false if the value is
equal to the default and EEnum-typed EAttributes always have the first
EEnumerator as their implicit default. You can use
OPTION_KEEP_DEFAULT_CONTENT as well as explicitly setting a default
value on the feature.


login wrote:
> I am working with Enum data type in GMF.
> I have created a Enum type as follow:
>
> enum DataType {
> String; Integer;
> Float;
> }
> This i have used as a attribute type for a node.
>
> I generated the diagram code .Runned as Eclipse application.
> I create a diagram and added Node .I changed the property of the
> node and saved it. here node is column and enum is the datatype for
> that column,
> Problem is that when i change the Enum datatype other than default it
> saves in the xml. but when i change the datatype to defualt it
> doesnt save.
>
> :( :(
>
> Here is the sample without default:
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns="spectrial" name="">
> <relational>
> <dimensionTable name="asdfa">
> <column name=""/>
> </dimensionTable>
> <factTable>
> <column name="sdsf" caption="" dataType="Integer"/>
> </factTable>
> </relational>
> </schema>
>
> With default datatype "string"
>
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns="spectrial" name="">
> <relational>
> <dimensionTable name="asdfa">
> <column name=""/>
> </dimensionTable>
> <factTable>
> <column name="sdsf" caption="" />
> </factTable>
> </relational>
> </schema>
>
>
>
> Any help would be appreciated.
>
> Thanks in Advance,
> login
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Migrating to GMF2.2
Next Topic:Un Set Command
Goto Forum:
  


Current Time: Sun Jun 23 18:54:31 GMT 2024

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

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

Back to the top