Database relationships are represented in EA by Associations.
The destination (target) role should be the key of the destination table that is being used for foreign key mapping. The origin (source) role should be the columnSet that makes up the corresponding values for the selected destination table key.
NOTE: under the relational model, the destination key merely has to be unique. It does not need to be the primary key. NOTE: IDEF1X standard
does enforce primary key only, but that's the US Department of Defence's problem, not ours.
The destination table keys are defined by stereotyped («PK», «unique») operations. These must be defined before they can be used as part of the relationship definition.
The origin columnSet is commonly known as the Foreign Key, but it doesn't need to have any indexing or keying applied - it's just a set of columns in the same order as the key you are mapping to in the destination table. Under the UML profile that EA uses for data modelling, the columnSet is represented as a stereotyped («FK») operation. Because of this, in order to be considered for the origin (source) role, the «FK» operation needs to be defined before use.
Accordingly, the destination (target) role drop-down MUST show
only those indexes on the destination table which are unique.
Similarly, the origin (source) role drop-down MUST show
only those («FK») operations - preferably ONLY those whose columnSet match the columnSet of the selected destination table key
[Edit: and which are not already in use].
This is not currently the case and can cause serious corruption as a consequence.In my view, a «index» stereotyped operation with the attribute
Unique should be re-stereotyped as «AK» - Alternate Key since, under the Relational Model, only Primary and Alternate Keys can be considered targets for database relationships.
Thoughts?
Paolo
[size=0]©2006 Paolo Cantoni, -Semantica-[/size]