Book a Demo

Author Topic: Multiple Foreign Keys To Same Table Primary Key  (Read 4403 times)

md55331

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Multiple Foreign Keys To Same Table Primary Key
« on: September 13, 2012, 06:25:01 am »
I have a table (source) that has more than one column (foreign key column) that maps to the same column in the same table.  Is there a way to model this in enterprise architecture.  The foreign key user interface doesn't appear to be able to do this for some reason.  When i try to create each foreign key separately, it creates a single key with some kind of appended name.  

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Multiple Foreign Keys To Same Table Primary Ke
« Reply #1 on: September 13, 2012, 08:58:45 am »
I just tried it and got it to work. The only obstacle I found was that when you create the second foreign key, EA will give it the same default name as the first one and then complain that a foreign key with that name already exists. Just rename one of them and all is good. Oh, and be aware that you can only assign one foreign key per association: if you want two FKs, create two associations.
The Sparx Team
[email protected]

md55331

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Multiple Foreign Keys To Same Table Primary Ke
« Reply #2 on: September 13, 2012, 11:26:36 pm »
is this a bug or a feature 8-), will this be improved in the next edition?