|
Re: "unique" handling problem [message #1085046 is a reply to message #1085036] |
Mon, 12 August 2013 11:26 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Mauro,
Comments below.
On 12/08/2013 1:11 PM, Mauro Candarelli wrote:
> Hi,
>
> in model I have a common EClass (Identifiable) that's the ancestor of
> almost all other EClasses.
>
> Identifiable has an EAttribute (id) marked as "unique".
Unique is only meaningful for multi-valued features, where it dictates
that there may be no duplicate values in the list...
> Intention was to have a id unique NOT between all Identifier's in the
> world, but within the derived class.
> i.e: if I have Station->Identifier and Machine->Identifier these two
> CAN have the same id, while two Machine's CANNOT.
Attributes that are id must be unique across all types of instances in
the resource.
>
> What is the right way to define this?
No.
>
> Default behavior seems to be to require uniqueness between every id
> regardless of inclusion in other EClasses, at least Diagnostician
> complains.
Yes.
>
> Note: in the model I NEVER instantiate Identifiable, only EClasses
> derived (extends) from it.
> Note2: the "id" should be akin to an auto-increment primary-key field
> in a database table. Obviously different tables should be permitted to
> have the same key.
There's no direct way to model that in Ecore.
>
> TiA
> Mauro
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02836 seconds