Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Adding attribute for relationship between entities
Adding attribute for relationship between entities [message #231046] Fri, 22 May 2009 09:54 Go to next message
Alireza Missing name is currently offline Alireza Missing nameFriend
Messages: 105
Registered: July 2009
Senior Member
Hello,

What I am trying to do is to have a gmf model with two entity e1 and e2
with a relationship and one attribute for the relationship. I do not want
to have an intermediate entity as relationship on my gmf diagram.

Best,

Alireza
Re: Adding attribute for relationship between entities [message #231062 is a reply to message #231046] Fri, 22 May 2009 10:05 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Alireza,

Just use LinkMapping with only linkMetaFeature specified.

-----------------
Alex Shatalin
Re: Adding attribute for relationship between entities [message #231071 is a reply to message #231062] Fri, 22 May 2009 10:09 Go to previous messageGo to next message
Alireza Missing name is currently offline Alireza Missing nameFriend
Messages: 105
Registered: July 2009
Senior Member
Well, I did not get it really! This attribute is like a real attribute,
not just a runtime annotation or note.
I checked the link mapping and I did not find linkmetafeature, where is
it? and what is it?
Re: Adding attribute for relationship between entities [message #231095 is a reply to message #231071] Fri, 22 May 2009 11:16 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Alireza,

> mapping and I did not find linkmetafeature, where is it? and what is
> it?
Sorry, it called "Target feature" in UI.

-----------------
Alex Shatalin
Re: Adding attribute for relationship between entities [message #231101 is a reply to message #231095] Fri, 22 May 2009 12:09 Go to previous messageGo to next message
Alireza Missing name is currently offline Alireza Missing nameFriend
Messages: 105
Registered: July 2009
Senior Member
It seems that this target feature determines the end direction of the
link, is it right?

Suppose that we have two entity: customer and items and the link between
them shows the customer buys the item. This relationship has a attribute
name quantity (how many of the item is bought by the customer), I want to
have it as a label for the link. This attribute first should be defined
somewhere in the ecore model, but where? and then how it can be added to
the gmf diagram, maybe as a label for link mapping or ...?
Re: Adding attribute for relationship between entities [message #231132 is a reply to message #231101] Fri, 22 May 2009 13:40 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Alireza,

Ok. then you have to set following properties for the link mapping:
- Containment Feature = Customer.links
- Element = Link (EClass representing relationship and having "quantity"
attribute)
- TargetFeature = Link.items
Then in accordance with GMF tutorial you can add label for this link representing
quantity attribute.

As an example you can use Ecore diagram editor - diagram editor generated
by GMF. In this editor EReference links are representing this type of links.

-----------------
Alex Shatalin
Re: Adding attribute for relationship between entities [message #231159 is a reply to message #231132] Sun, 24 May 2009 16:59 Go to previous messageGo to next message
Alireza Missing name is currently offline Alireza Missing nameFriend
Messages: 105
Registered: July 2009
Senior Member
To tell the truth, I could not figure out what you sent me in last post :(
Could you please give more explanation or ...?
Re: Adding attribute for relationship between entities [message #231178 is a reply to message #231159] Mon, 25 May 2009 10:27 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Alireza,

> To tell the truth, I could not figure out what you sent me in last
> post :( Could you please give more explanation or ...?
I suggest you to read all parts of GMF tutorial (http://wiki.eclipse.org/index.php/GMF_Tutorial)
- your use case should be covered there.

-----------------
Alex Shatalin
Re: Adding attribute for relationship between entities [message #231215 is a reply to message #231178] Mon, 25 May 2009 12:18 Go to previous messageGo to next message
Alireza Missing name is currently offline Alireza Missing nameFriend
Messages: 105
Registered: July 2009
Senior Member
Dear Alex Shatalin,

I have reviewed the gmf tutorials again, in tutorial three there is a part
that seems to be related to my problem, but it is not. It try to create 3
relationships based on relationship type attribute, wheres the attribute
of the relationship in my case can be arbitrary number.
Could you please help me to handle this? I have already spent a lot of
time for it ... :(
Re: Adding attribute for relationship between entities [message #231222 is a reply to message #231215] Mon, 25 May 2009 14:24 Go to previous message
Alireza Missing name is currently offline Alireza Missing nameFriend
Messages: 105
Registered: July 2009
Senior Member
Dear Alex Shatalin,

Finally I did it :) Thank you very much.

Best,
Ali
Previous Topic:Multiple labels/Parser
Next Topic:Labels broken?
Goto Forum:
  


Current Time: Fri Apr 26 15:41:12 GMT 2024

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

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

Back to the top