Skip to main content



      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 12:05 Go to next message
Eclipse UserFriend
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 171 times)
  • Attachment: My.genmodel
    (Size: 2.25KB, Downloaded 214 times)
  • Attachment: My.miniexample
    (Size: 0.33KB, Downloaded 195 times)
  • Attachment: unnamed.png
    (Size: 18.09KB, Downloaded 286 times)

[Updated on: Tue, 17 July 2012 12:06] by Moderator

Re: ID in derived EClass seems the same in different containments [message #896343 is a reply to message #896226] Wed, 18 July 2012 02:56 Go to previous messageGo to next message
Eclipse UserFriend
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.
>
Re: ID in derived EClass seems the same in different containments [message #896381 is a reply to message #896343] Wed, 18 July 2012 04:44 Go to previous message
Eclipse UserFriend
>> 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 Jul 03 18:19:07 EDT 2025

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

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

Back to the top