|
|
|
Re: Property "Unique" for ecore attribute doesn't work [message #621463 is a reply to message #621445] |
Tue, 13 October 2009 11:45 |
Carlos Messages: 52 Registered: September 2009 |
Member |
|
|
Ed,
I have installed Helios distribution, and after that, I have installed EMF: "eclipse-SDK-3.6M2-win32".
When I define an entity attribute in my metamodel, I hope that in runtime, I should not be able to create two or more entities with the same value for that attribute (it was defined like unique).
However, I can do that.
I think that when I open a model with the editor in runtime, editor might should show the error of duplicate attribute in the "problems" tab, like occurs with other type of errors.
Is this OK?
In other case, what can be happening?
Thanks.
|
|
|
Re: Property "Unique" for ecore attribute doesn't work [message #621464 is a reply to message #621463] |
Tue, 13 October 2009 12:47 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Carlos,
I believe you're misinterpreting what unique means. It means that, for
a multi-valued feature, any given value can appear at most once. It
doesn't mean that two different objects can't have the same value for
that feature; that's more like having isID be true.
Carlos wrote:
> Ed,
>
> I have installed Helios distribution, and after that, I have installed
> EMF: "eclipse-SDK-3.6M2-win32".
>
> When I define an entity attribute in my metamodel, I hope that in
> runtime, I should not be able to create two or more entities with the
> same value for that attribute (it was defined like unique).
> However, I can do that.
>
> I think that when I open a model with the editor in runtime, editor
> might should show the error of duplicate attribute in the "problems"
> tab, like occurs with other type of errors.
> Is this OK? In other case, what can be happening?
>
> Thanks.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
Re: Property "Unique" for ecore attribute doesn't work [message #1746762 is a reply to message #621466] |
Fri, 04 November 2016 10:17 |
Eclipse User |
|
|
|
Hello Ed, I have experienced a similar problem. There is a reference list from A to B, in other words A has an attribute list<B> and this reference is set to be unique. I even put two OCL constraints stating the list should contain only unique elements (based on the element's id and based on the element's reference).
Despite all of this, I can create a model instance that has non-unique reference list and the validator validates successfully.
My Eclipse configuration is: Version: Mars.2 Release (4.5.2) , Build id: 20160218-0600.
|
|
|
Re: Property "Unique" for ecore attribute doesn't work [message #1746769 is a reply to message #1746762] |
Fri, 04 November 2016 11:28 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
You're posting a very old thread. You talk about reference list from A to B and then talk about an attribute list and about setting unique. In general multi-valued references are always unique even if you set unique to be false. You claim you can create a model instance that has a non-unique reference list. But I don't know how you did that, and I can't verify anything like that without a test case. Your post contains no question and the image tells me nothing about your problem.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.04034 seconds