Title: RE: (ROSE) Data Model and 2 classes with 2 parent associations each with oth er
Yes there is a scripting solution to this problem.
 
You need two files.
 
First is DMcom which is a library for working with Data Modeler elements that
simplifies working with DM.
 
Second program (which relies on the above library) will then allow you
to set the FK in the child to the same column in both parents.
 
You can download these files from,
 
http://www.rational.com/support/downloadcenter/addins/rose/index.jsp
 
filename: DMeX/DMCOM
 
QUESTION:
I am using Rational Rose 2002 SR-2 Data Modeler. I would like to create a foreign
key constraint on the columns, which I have defined previously. The problem is,
that when I create the relationship, always new column(s) are created. I have to
delete the existing columns and rename newly created ones. How can I put foreign
key constrain on existing columns ?
 
ANSWER:
Data Modeler takes "parent key migration" approach when creating relationships.
In this aproach always new columns are created in child table. There is no
direct support for creating FK constraints on existing columns.
To overcome this issue, one can use the add-in called DMeX. This add-in allows
users to create foreign keys in both ways - with migrated and for existing columns.
thank you,
 
Patrick Kennedy
 Rational Support
 

(478KB)
-----Original Message-----
From: Amine BELOUALI [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 20, 2002 12:33 AM
To: Gornik, Davor; Amine BELOUALI; [EMAIL PROTECTED]
Subject: RE: (ROSE) Data Model and 2 classes with 2 parent associations ea ch with oth er

thanks for your help Davor,
 
Unfortunatly i have model with tens of such as associations and i pass from my object model to my data model to my generated code many times a day!!!
so you can imagine the time i spend to work arround this problem
 
is there a way to correct this with Rose Scripting ???
 
tx
Amine
 
 
-----Message d'origine-----
De : Gornik, Davor [mailto:[EMAIL PROTECTED]]
Envoy� : jeudi 19 d�cembre 2002 00:34
� : Amine BELOUALI; [EMAIL PROTECTED]
Objet : RE: (ROSE) Data Model and 2 classes with 2 parent associations ea ch with oth er

Amine,

You can rename the column in the child table after you draw the relationship. There is no way for you to define the name of the foreign key column at generation time.


Regards,

Davor Gornik
Rational Software

+1(425)497-4091
[EMAIL PROTECTED]


-----Original Message-----
From: Amine BELOUALI [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 12:22 AM
To: [EMAIL PROTECTED]
Subject: (ROSE) Data Model and 2 classes with 2 parent associations each with oth er



Hi all,

suppose you have 2 persistent classes A (a1, a2) and B (b1, b2) and you have
a parent association between A and B.

if you generate your Data Model in Rose you will have something like this

Table A : T_A (A_ID, a1, a2, B_ID) (where B_ID is a foreign key migrated
from B)
Table B : T_B (B_ID, b1, b2)

That's OK

Now suppose that A have 2 parent associations with B!

Rose will generate something like this :

Table A : T_A (A_ID, a1, a2, B_ID, col246)
Table B : T_B (B_ID, b1, b2)

he put "col246" as he can't give the same name "B_ID" to 2 different
columns.

Is there any way to have something like "B_ID_1" and "B_ID_2" ???

Your help will be appreciated

thanks in advance

Amine


************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
* Only plain-text messages are supported.
* HTML or Rich-Text messages may be rejected.
*
* Post or Reply to: [EMAIL PROTECTED]
* Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
*    http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*    To: [EMAIL PROTECTED]
*    Subject: <BLANK>
*    Body: unsubscribe rose_forum
*************************************************************************

Reply via email to