Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » ID in derived EClass seems the same in different containments
ID in derived EClass seems the same in different containments [message #896226] Tue, 17 July 2012 16:05 Go to next message
John M. is currently offline John M.Friend
Messages: 198
Registered: July 2010
Senior Member
Hello,

I have a model, which contains a abstract EClass with two attributes and one of it is an ID.
That EClass is extended by two others EClass declarations.

The validation doesn't succeed because I use in different containments the same ID.

I have attached a miniexample for demonstrating.

On the picture you can see, that the validation says that both in another list contained IDs collide with the first one (Ex Definition1 Test).
index.php/fa/10733/0/
  • Attachment: My.ecore
    (Size: 2.42KB, Downloaded 155 times)
  • Attachment: My.genmodel
    (Size: 2.25KB, Downloaded 196 times)
  • Attachment: My.miniexample
    (Size: 0.33KB, Downloaded 171 times)
  • Attachment: unnamed.png
    (Size: 18.09KB, Downloaded 245 times)

[Updated on: Tue, 17 July 2012 16:06]

Report message to a moderator

Re: ID in derived EClass seems the same in different containments [message #896343 is a reply to message #896226] Wed, 18 July 2012 06:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Comments below.

On 17/07/2012 6:05 PM, Missing name Mising name wrote:
> Hello,
>
> I have a model, which contains a abstract EClass with two attributes and one of it is unique.
Unique in what context?
> That EClass is extended by two others EClass declarations.
>
> The validation doesn't succeed because I use in different containments the same ID.
An ID means it must be unique within the scope of all objects of all
types in any given resource.
>
> I have attached a miniexample for demonstrating.
>
> On the picture you can see, that the validation says that both in another list contained IDs collide with the first one (Ex Definition1 Test).
Yes, I'd expect that. Perhaps you want to make use of EReference.eKeys
so that the containment reference itself declares which combination of
attributes in the referenced class are unique within the context of a
single containment list.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: ID in derived EClass seems the same in different containments [message #896381 is a reply to message #896343] Wed, 18 July 2012 08:44 Go to previous message
John M. is currently offline John M.Friend
Messages: 198
Registered: July 2010
Senior Member
>> On the picture you can see, that the validation says that both in another list contained IDs collide with the first one (Ex Definition1 Test).
> Yes, I'd expect that. Perhaps you want to make use of EReference.eKeys
> so that the containment reference itself declares which combination of
> attributes in the referenced class are unique within the context of a
> single containment list.

Thanks for the advice, it is what I need.
Previous Topic:master-detail scenario
Next Topic:[xcore] not serialize a specific property
Goto Forum:
  


Current Time: Thu Apr 18 02:48:40 GMT 2024

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

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

Back to the top