Book a Demo

Author Topic: Really Confused about foriegn keys  (Read 3183 times)

Sql Server DBA

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Really Confused about foriegn keys
« on: July 11, 2008, 05:40:54 am »
I'm trying to rescue the ERD drawings that I apparently destroyed by importing table defs from the database a second time and am going in circles trying to add the Foriegn Keys back to the model.

In the help it says:

Create a Foriegn Key:
  1. Locate the required tables in a diagram
  2. Select an association link in the Class Toolbar

Okay, on the View Menu under Tool bars I don't see a class toolbar.

I found a toolbar with a Link drop down menu but that doesn't seem to be it.

A Foriegn Key seems to be an operation.  So I right click the table, pick operations, click new, enter a name, set the Stereotype to FK.. and it says "Creating foriegn key operations here could cause inconsistencies.  Use the Foriegn Key Dialog to create foriegn key operations.  Right click on the Association Link and select Foreigh Keys  What the )(*$)_@$ is the "Association Link"?  On the regular toolbar there are several association types but none of them have menu choices for Foriegn Keys.

Which is probably good advice, because in the operations menu whereas I can define the FK, and the column in the source table, I cannot for the life of me figure out how to tell it what table the relationship goes to.

I'm sure this is ridiculously easy...

hd

  • EA Administrator
  • EA User
  • *****
  • Posts: 312
  • Karma: +0/-0
    • View Profile
Re: Really Confused about foriegn keys
« Reply #1 on: July 11, 2008, 08:16:57 am »
Select the Foreign Key (source) table on the diagram.

Using the quick linker (small arrow at top right of table) drag it to the unique/primary key table (target).

Select Association from the context menu when you drop.

Select Foreign Keys... from the connector context menu.



RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Really Confused about foriegn keys
« Reply #2 on: July 11, 2008, 09:06:41 am »
It looks as if you are using a release of EA prior to 7.1. The web help and the product Help for 7.1 direct you to "select an Associate link in the Class Relationships page of the Enterprise Architect UML Toolbox."

A link is a connector, the physical representation of a relationship between two elements. You drag the required connector onto a diagram from the Toolbox of element and connector icons, or select one from the Quick Linker menu as Henk suggests.

When you have created the connector, you right-click on it to display the context menu for the connector, and you select the Foreign Key option to display the Foreign Key Constraint dialog.

I will go through the Help and change all the 'Link' references to 'Connector', to remove this ambiguity. The earlier Help refered to a Toolbar when it should have been the Toolbox, but that has now been corrected.

Sorry for the confusion!
Best Regards, Roy

Sql Server DBA

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Really Confused about foriegn keys
« Reply #3 on: July 11, 2008, 11:04:48 pm »
HD / Roy -- Thank you Thank you.

I knew the answer was easy -- and now I know what that little arrow next to the tables means  :)