Ekeys with mutiple keys [message #170464] |
Tue, 29 January 2008 14:03 |
Eclipse User |
|
|
|
Originally posted by: frederic.ventura.eurogiciel.fr
Hi everybody
I'm trying to modify my ecore model for my GMF diagram editor (linked to a
database)
My diagram contains team/player/match/history...
to do the relation between history and player, I have an EReference in
History (with EreferenceType=player and Ekeys= FirsName, LastName).
My problem is that when tables are created, the link is done using the
player_ID in spite of combination of FirstName and LastName
is there any solution to do this?
I've seen that if ekeys are not ID in target, ekeys are not used and the
database ID is used
The problem is, in case of composed ekeys, I can't use two attributes as
ID in ecore model (when I generate the genmodel, an error is raised : The
features 'firstname' and 'lastname' cannot both be IDs)
|
|
|
Re: Ekeys with mutiple keys [message #170504 is a reply to message #170464] |
Tue, 29 January 2008 14:46 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Fred,
Keep in mind that a key need not be unique within a resource across all
object types as is the case for an ID; it need only be unique with
respect to the one particular reference. You could define a transient
volatile derived ID feature that combines the first and the last name,
but indeed, if there is an ID, it will be preferred over any other form
of reference. ID's with spaces are likely to cause problems too...
fred wrote:
> Hi everybody
>
> I'm trying to modify my ecore model for my GMF diagram editor (linked
> to a database)
> My diagram contains team/player/match/history...
> to do the relation between history and player, I have an EReference in
> History (with EreferenceType=player and Ekeys= FirsName, LastName).
> My problem is that when tables are created, the link is done using the
> player_ID in spite of combination of FirstName and LastName
>
> is there any solution to do this?
>
> I've seen that if ekeys are not ID in target, ekeys are not used and
> the database ID is used
> The problem is, in case of composed ekeys, I can't use two attributes
> as ID in ecore model (when I generate the genmodel, an error is raised
> : The features 'firstname' and 'lastname' cannot both be IDs)
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02645 seconds