Book a Demo

Author Topic: Foreign Key Role Names  (Read 3058 times)

Owl Saver

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
  • Never give up.
    • View Profile
Foreign Key Role Names
« on: July 30, 2006, 09:41:52 am »
I run into situations where two tables must be linked twice. For example, in a hierarchy, one table is people and one table is relationships. The relationships table has two links to the people table, one called Parent and the other called Child. I can do this in ERWin with a feature called Role Names - it lets me rename the foreign key from PersonID to ParentID or ChildID.

Does EA have a similar role naming facility for foreign keys?

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Foreign Key Role Names
« Reply #1 on: August 01, 2006, 08:55:22 am »
If I understand your question correctly,  wouldn't the role names be defined on the association ends?

In the properties for the links, set the role names for the Source and Target ends of the aggregations.
Verbal Use Cases aren't worth the paper they are written upon.

Owl Saver

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
  • Never give up.
    • View Profile
Re: Foreign Key Role Names
« Reply #2 on: August 01, 2006, 06:53:31 pm »
I looked into it. The Foreign Key name comes from the relationship name. However, I could not get the relationship name to change. A little more background:

I am building a class model. I will then use the transform to build both a Java and a Database model. Right now, I am testing the Database model. In the clas model, I have to one way associations. They have different name. When I generate the Database model, the relationships have the name of the two tables. For example, linking the Person and Role classes would create a FK_Person_Role relationship between the tables. I think I may need to keep trying out different combinations. Any insight would be greatly appreciated.

Take Care

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Foreign Key Role Names
« Reply #3 on: August 01, 2006, 07:11:31 pm »
Quote
I looked into it. The Foreign Key name comes from the relationship name. However, I could not get the relationship name to change.

I think you can just change the name of the FK operation...
The Sparx Team
[email protected]