Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Property "Unique" for ecore attribute doesn't work
Property "Unique" for ecore attribute doesn't work [message #490571] Fri, 09 October 2009 08:51 Go to next message
Carlos  is currently offline Carlos Friend
Messages: 52
Registered: September 2009
Member
Hi.

I want to define an ecore attribute (metamodel) which value can't occur more than once in the model.
For making that, I use the ecore editor (properties view) and set the property "Unique" to value "true".
However, when I execute the program, the editor don't check this issue, and I can add several items which contains the same value for that attribute.
The editor indicates for Unique property "Whether the same value may occur more than once". I have tried to set the value to "false", but the I get the same result.
Is this a bug or I have to use other property to get a "primary key"?

Thanks in advance.
Carlos.
Re: Property "Unique" for ecore attribute doesn't work [message #490575 is a reply to message #490571] Fri, 09 October 2009 09:02 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Carlos,

This sounds like https://bugs.eclipse.org/bugs/show_bug.cgi?id=289200


Carlos wrote:
> Hi.
>
> I want to define an ecore attribute (metamodel) which value can't
> occur more than once in the model.
> For making that, I use the ecore editor (properties view) and set the
> property "Unique" to value "true".
> However, when I execute the program, the editor don't check this
> issue, and I can add several items which contains the same value for
> that attribute.
> The editor indicates for Unique property "Whether the same value may
> occur more than once". I have tried to set the value to "false", but
> the I get the same result.
> Is this a bug or I have to use other property to get a "primary key"?
>
> Thanks in advance.
> Carlos.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Property "Unique" for ecore attribute doesn't work [message #491087 is a reply to message #490571] Tue, 13 October 2009 08:29 Go to previous messageGo to next message
Carlos  is currently offline Carlos Friend
Messages: 52
Registered: September 2009
Member
Hi Ed,

I have tried to update the EMF package:

EMF SDK 2.6.0M2 S200909211047 (EMF + XSD)

but when I install the package, the installer shows the next message.
Where can I get "org.eclipse.ui.ide [3.6.0,4.0.0)"?
I have been looking for that release, but I don't have found it.
------------
Cannot complete the install because one or more required items could not be found.
Software being installed: EMF Sample Ecore Editor 2.6.0.v200909211047 (org.eclipse.emf.ecore.editor.feature.group 2.6.0.v200909211047)
Missing requirement: EMF Sample Ecore Editor 2.6.0.v200909211047 (org.eclipse.emf.ecore.editor 2.6.0.v200909211047) requires 'bundle org.eclipse.ui.ide [3.6.0,4.0.0)' but it could not be found
Cannot satisfy dependency:
From: EMF Sample Ecore Editor 2.6.0.v200909211047 (org.eclipse.emf.ecore.editor.feature.group 2.6.0.v200909211047)
To: org.eclipse.emf.ecore.editor [2.6.0.v200909211047]
--------------

Thanks in advance.
Carlos.
Re: Property "Unique" for ecore attribute doesn't work [message #491092 is a reply to message #491087] Tue, 13 October 2009 08:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Carlos,

You need Eclipse 3.6 (Helios) to work with this version of EMF.


Carlos wrote:
> Hi Ed,
>
> I have tried to update the EMF package:
>
> EMF SDK 2.6.0M2 S200909211047 (EMF + XSD)
>
> but when I install the package, the installer shows the next message.
> Where can I get "org.eclipse.ui.ide [3.6.0,4.0.0)"?
> I have been looking for that release, but I don't have found it.
> ------------
> Cannot complete the install because one or more required items could
> not be found.
> Software being installed: EMF Sample Ecore Editor 2.6.0.v200909211047
> (org.eclipse.emf.ecore.editor.feature.group 2.6.0.v200909211047)
> Missing requirement: EMF Sample Ecore Editor 2.6.0.v200909211047
> (org.eclipse.emf.ecore.editor 2.6.0.v200909211047) requires 'bundle
> org.eclipse.ui.ide [3.6.0,4.0.0)' but it could not be found
> Cannot satisfy dependency:
> From: EMF Sample Ecore Editor 2.6.0.v200909211047
> (org.eclipse.emf.ecore.editor.feature.group 2.6.0.v200909211047)
> To: org.eclipse.emf.ecore.editor [2.6.0.v200909211047]
> --------------
>
> Thanks in advance.
> Carlos.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Property "Unique" for ecore attribute doesn't work [message #491094 is a reply to message #491092] Tue, 13 October 2009 08:55 Go to previous messageGo to next message
Carlos  is currently offline Carlos Friend
Messages: 52
Registered: September 2009
Member
Thanks for this answer so fast.
(I was working with Galileo)
Re: Property "Unique" for ecore attribute doesn't work [message #491118 is a reply to message #490571] Tue, 13 October 2009 11:45 Go to previous messageGo to next message
Carlos  is currently offline Carlos Friend
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 #491137 is a reply to message #491118] Tue, 13 October 2009 12:47 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
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 #491162 is a reply to message #490571] Tue, 13 October 2009 13:52 Go to previous messageGo to next message
Carlos  is currently offline Carlos Friend
Messages: 52
Registered: September 2009
Member
Ed,

I really was using both issues...
Besides setting the attribute like "unique" (my mistake of conception for that property), I was setting the property "ID" to "true" too.
So, the editor should show a message in "problems" tab indicating that the model has several entities with the same id, or not?

Is there any way to get this function?

Thank you very much.
Re: Property "Unique" for ecore attribute doesn't work [message #491183 is a reply to message #491162] Tue, 13 October 2009 14:57 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Carlos,

You have to invoke "Validate..." for the generated editor in check for
all the constraint violations.


Carlos wrote:
> Ed,
> I really was using both issues...
> Besides setting the attribute like "unique" (my mistake of conception
> for that property), I was setting the property "ID" to "true" too.
> So, the editor should show a message in "problems" tab indicating that
> the model has several entities with the same id, or not?
>
> Is there any way to get this function?
>
> Thank you very much.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Property "Unique" for ecore attribute doesn't work [message #491308 is a reply to message #491183] Wed, 14 October 2009 05:58 Go to previous messageGo to next message
Carlos  is currently offline Carlos Friend
Messages: 52
Registered: September 2009
Member
Ok.
Then, I have to define an OCL rule to check that issue like like any other validation case. (I thought that the editor should check that attibute for being an XMI identifier).
I'm generating a UUID for any object in my model, although I wanted to be sure that there was not any repeated identifiers.

Thank you very much for your attention.
Re: Property "Unique" for ecore attribute doesn't work [message #491316 is a reply to message #491308] Wed, 14 October 2009 06:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Carlos,

There is already a validation rule to check for ID uniqueness, but you
need to invoke that validation checking explicitly.


Carlos wrote:
> Ok.
> Then, I have to define an OCL rule to check that issue like like any
> other validation case. (I thought that the editor should check that
> attibute for being an XMI identifier).
> I'm generating a UUID for any object in my model, although I wanted to
> be sure that there was not any repeated identifiers.
>
> Thank you very much for your attention.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Property "Unique" for ecore attribute doesn't work [message #491325 is a reply to message #491316] Wed, 14 October 2009 07:29 Go to previous messageGo to next message
Carlos  is currently offline Carlos Friend
Messages: 52
Registered: September 2009
Member
Ok.
I already have tested that validation by default check the identifiers of the model elements, and if there is some collision, shows messages indicating: The ID 'X' of 'X' collides with 'Z'.

Greetings.
Carlos.
Re: Property "Unique" for ecore attribute doesn't work [message #621460 is a reply to message #491087] Tue, 13 October 2009 08:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Carlos,

You need Eclipse 3.6 (Helios) to work with this version of EMF.


Carlos wrote:
> Hi Ed,
>
> I have tried to update the EMF package:
>
> EMF SDK 2.6.0M2 S200909211047 (EMF + XSD)
>
> but when I install the package, the installer shows the next message.
> Where can I get "org.eclipse.ui.ide [3.6.0,4.0.0)"?
> I have been looking for that release, but I don't have found it.
> ------------
> Cannot complete the install because one or more required items could
> not be found.
> Software being installed: EMF Sample Ecore Editor 2.6.0.v200909211047
> (org.eclipse.emf.ecore.editor.feature.group 2.6.0.v200909211047)
> Missing requirement: EMF Sample Ecore Editor 2.6.0.v200909211047
> (org.eclipse.emf.ecore.editor 2.6.0.v200909211047) requires 'bundle
> org.eclipse.ui.ide [3.6.0,4.0.0)' but it could not be found
> Cannot satisfy dependency:
> From: EMF Sample Ecore Editor 2.6.0.v200909211047
> (org.eclipse.emf.ecore.editor.feature.group 2.6.0.v200909211047)
> To: org.eclipse.emf.ecore.editor [2.6.0.v200909211047]
> --------------
>
> Thanks in advance.
> Carlos.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Property "Unique" for ecore attribute doesn't work [message #621461 is a reply to message #491092] Tue, 13 October 2009 08:55 Go to previous messageGo to next message
Carlos  is currently offline Carlos Friend
Messages: 52
Registered: September 2009
Member
Thanks for this answer so fast.
(I was working with Galileo)
Re: Property "Unique" for ecore attribute doesn't work [message #621468 is a reply to message #491183] Wed, 14 October 2009 05:58 Go to previous messageGo to next message
Carlos  is currently offline Carlos Friend
Messages: 52
Registered: September 2009
Member
Ok.
Then, I have to define an OCL rule to check that issue like like any other validation case. (I thought that the editor should check that attibute for being an XMI identifier).
I'm generating a UUID for any object in my model, although I wanted to be sure that there was not any repeated identifiers.

Thank you very much for your attention.
Re: Property "Unique" for ecore attribute doesn't work [message #621469 is a reply to message #491308] Wed, 14 October 2009 06:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Carlos,

There is already a validation rule to check for ID uniqueness, but you
need to invoke that validation checking explicitly.


Carlos wrote:
> Ok.
> Then, I have to define an OCL rule to check that issue like like any
> other validation case. (I thought that the editor should check that
> attibute for being an XMI identifier).
> I'm generating a UUID for any object in my model, although I wanted to
> be sure that there was not any repeated identifiers.
>
> Thank you very much for your attention.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Property "Unique" for ecore attribute doesn't work [message #621470 is a reply to message #491316] Wed, 14 October 2009 07:29 Go to previous message
Carlos  is currently offline Carlos Friend
Messages: 52
Registered: September 2009
Member
Ok.
I already have tested that validation by default check the identifiers of the model elements, and if there is some collision, shows messages indicating: The ID 'X' of 'X' collides with 'Z'.

Greetings.
Carlos.
Previous Topic:[Teneo] Lazy-loading one-to-many EList
Next Topic:How to get involve
Goto Forum:
  


Current Time: Sat Apr 20 04:26:08 GMT 2024

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

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

Back to the top