Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » How to add a map with generics?
How to add a map with generics? [message #1764654] Thu, 01 June 2017 08:14 Go to next message
Udo Walker is currently offline Udo WalkerFriend
Messages: 48
Registered: January 2013
I use Ecoretools and want to add a java.util.Map to my model with the key type java.lang.String and the value type my.ClazzType where my.ClazzType is also part of the same model.

I want to use the map as attribute in one of my classes of this same model.

What steps do I have to follow to add this in the class diagram?

With regards,
Re: How to add a map with generics? [message #1764660 is a reply to message #1764654] Thu, 01 June 2017 08:46 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7293
Registered: July 2009
Senior Member

Maps are not one of EMF's strongest facilities. I failed to use them for many years but eventually felt guilty and tried again. You can find an example and some of my troubles in

To be honest, my recommendation is that if you want non-trivial efficient Maps you consider implementing them by manual coding behind a modeled API in the generated Java classes.


Ed Willink
Re: How to add a map with generics? [message #1764669 is a reply to message #1764660] Thu, 01 June 2017 09:33 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 32079
Registered: July 2009
Senior Member
See for details. You can accomplish the same tasks as described in the FAQ using the Ecore Tools editor. It obviously works because Ecore itself uses it and we have many cases of using it in Oomph's setup models.

Ed Merks
Professional Support:
Previous Topic:Question Generating from XSD
Next Topic:EMFStore on Tomcat: How to set it up using MongoDB?
Goto Forum:

Current Time: Wed Oct 27 11:12:38 GMT 2021

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

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

Back to the top