Book a Demo

Author Topic: Foreign Keys  (Read 5401 times)

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Foreign Keys
« on: January 11, 2010, 02:19:49 pm »
I'm struggling with foreight keys, while doing a little bit of physical data modelling (somebody has to).



In the above diag I have created an association, selected Foreign Keys from the association context menus, and get the message shown.

« Last Edit: January 11, 2010, 03:04:10 pm by skiwi »
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Foreign Keys
« Reply #1 on: January 11, 2010, 03:03:55 pm »
OK, being a bit disingenuous here, because I went and read the documentation and found the answer.

This is an example where order matters. To quote from http://www.sparxsystems.com/uml_tool_guide/data_modeling/create_a_foreign_key.html "Click on the Table to contain the Foreign Key (source) and draw the connector to the other Table (target)."

So, well and good, I create a new association in the correct order, and manage to create a foreign key (see image).

But I don't see the connector labels appearing as is implied by the documentation.
And I don't see the relationship appear in the FK dialogue box.
Am I missing something.

Finally, in my excitement of creating a foreign key I forget to set the correct cardinality,
but blowed if I can find out how to see the (default) values that were entered, or where to change them.

Suggestions and comments welcome.
« Last Edit: January 12, 2010, 08:55:51 am by skiwi »
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Foreign Keys
« Reply #2 on: January 11, 2010, 03:43:16 pm »
Hi Simon,

It's worked for me in the past.  I notice that the end of the relationship aren't showing the crows feet correctly.  Is that because you haven't setup the diagram to show IE connectors?

If you have (set it up), that may be part of the problem.  You're not running on "bog standard" windows are you?

You should be able to edit the cardinality as part of the standard properties of the Association.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Foreign Keys
« Reply #3 on: January 12, 2010, 08:55:27 am »
Hi Paulo, thanks for your help.
The diagram properties are more or less at the defaults, including Information Engineering as the default, and barring showing stereo types.
Label visibility is set to show all labels.
This is part of what puzzled me.
Having set up the foreign key relationship (evidenced by the FK shown in the MeshblockHistory table), which included cardinalities, they do not show up on the diagram,
or in the association properties!


Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Foreign Keys
« Reply #4 on: January 12, 2010, 09:37:13 am »
Got me beat.

But one thing I'd try is to first set up the association with the cardinalities in the source and target.  Check EA shows it correctly in the diagram.  THEN add the FK.  See what changes - may help sort out the problem.

I normally work this way when I'm designing.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!