Book a Demo

Author Topic: Creating multiple foreign key associations  (Read 10304 times)

ScorpioTiger

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Creating multiple foreign key associations
« on: May 06, 2010, 02:30:44 am »
Hi folks,

I'm still fumbling my way around EA and enjoying the journey.

Today I found myself trying to create two associations between two entities for a data modelling project. Basically, I have a primary key of [pk_contact] in one table, and two foreign keys [fk_primary_contact], and [fk_secondary_contact] that both relate to [pk_contact]. For the life of me I can't figure this out. If I try to add a second association, EA just highlights the first association. The foreign keys dialogue box doesn't give me the option to create more than one association.

I'm sure the answer is simple....help....!! (and thanks in advance)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Creating multiple foreign key associations
« Reply #1 on: May 06, 2010, 05:21:44 am »
Firstly, which version of EA are you using, in what environment?

[edit]Well, I haven't used the data modelling portion of EA for a few months.

But I knew you CAN create multiple associations between tables.

In quickly refreshing my understanding I've found 4 bugs (quite serious) in 3 minutes.  2 I think I reported years ago, and 2 (the really bad ones) are brand new!

Can someone else have a look and report them?  I think I've done my bit for the user community for a while...

I'm glad Sparx is proud to announce new releases, because if I produced software of this quality ::), I wouldn't be.

See also: How To Create Table Relationships in a Schema for CoffeeAddict's view on the subject[/edit]

Paolo
      
[size=9]Using EA in spite of EA, NOT because of it!TM[/size]
« Last Edit: May 06, 2010, 06:07:48 am by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

ScorpioTiger

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Creating multiple foreign key associations
« Reply #2 on: May 06, 2010, 06:52:43 pm »
Quote
Firstly, which version of EA are you using, in what environment?

I'm using 7.5.848 Corporate Edition on Windows 7.


Ok. Seems I've come unstuck by by an assumption...the assumption that when EA creates a second association that it doesn't place the connector precisely over the first, and thus appearing to the user that it has done nothing. Turns out I had a half dozen of my attempts one on top of the other and appearing as a single connector. And of course selecting this apparently single connector always selects the uppermost, so you don't get any hints from differing properties in the dialogue.

Whilst correcting this I did find something that would appear to be a bug. I had a foreign key defined for my first association which had two foreign keys relating to a single target primary key...certainly not right, so I selected the appropriate attributes and hit 'Save', only to find it didn't update it at all. I had to delete the association and start again. Pretty poor.
« Last Edit: May 06, 2010, 10:36:30 pm by ScorpioTiger »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Creating multiple foreign key associations
« Reply #3 on: May 06, 2010, 10:29:13 pm »
So you're good to go?

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

ScorpioTiger

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Creating multiple foreign key associations
« Reply #4 on: May 06, 2010, 10:34:13 pm »
Quote
So you're good to go?

Paolo

Yes, good to go...thanks.

ScorpioTiger

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Creating multiple foreign key associations
« Reply #5 on: May 10, 2010, 05:36:02 pm »
Arrhh..!! Just when I thought it was safe to go back in the water.

I can now create multiple associations for my foreign keys. Now when I go and change one association, it changes all of them...! I went through and one by one and defined my foreign keys, and then thought I'd go through them again and just make sure it was right only to find the first one looked just like the last one...and they're all the same..!

How can EA have this bug? This makes the product unusable.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Creating multiple foreign key associations
« Reply #6 on: May 10, 2010, 07:07:00 pm »
OK... If you want, I'll have a look (later).  I'm pretty sure it used to work OK...

But it will cost you...  You'll have to go through the dialog and log every UI bug you find...  ::)

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

son-of-sargasso

  • EA User
  • **
  • Posts: 122
  • Karma: +0/-0
    • View Profile
Re: Creating multiple foreign key associations
« Reply #7 on: May 10, 2010, 10:19:06 pm »
Quote
But it will cost you...  You'll have to go through the dialog and log every UI bug you find..

SADIST! You know that's a lifetime's work.  Couldn't he just notice them and enjoy them as much as you do!

hehehehe
Bruce   ooops
bruce







(it was obviously a UI bug!)  :-X

Seriously though, I just went and tried this and it didn't happen.  So I tried it again and noticed that I have had a habit of moving the first FK relationship as soon as it was created.  Strange how you can get into so much of a habit around here that you don't even notice the bug/workaround anymore!  Dog, knows how many more of these there are ?   :o
« Last Edit: May 10, 2010, 10:24:54 pm by barrydrive »

ScorpioTiger

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Creating multiple foreign key associations
« Reply #8 on: May 12, 2010, 08:24:18 pm »
Ok, I've $%&*'ed around and $%&*'ed around and just can't get it to work. I've tried moving them after creation. I've tried creating multiple association before setting the foreign key attributes. Nothing works.

How is it that you are all creating multiple foreign key constraints? Is there a work around or is it that nobody is really using this product for anything serious?

Somebody please enlighten me...!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Creating multiple foreign key associations
« Reply #9 on: May 12, 2010, 09:19:56 pm »
Quote
Ok, I've $%&*'ed around and $%&*'ed around and just can't get it to work. I've tried moving them after creation. I've tried creating multiple association before setting the foreign key attributes. Nothing works.

How is it that you are all creating multiple foreign key constraints? Is there a work around or is it that nobody is really using this product for anything serious?

Somebody please enlighten me...!
I can only re-iterate that I am able to create two different Associations with two different child columns (to the same parent key column - in this case the PK) - EAUI not withstanding... (build 856)

Did you ensure you used DIFFERENT FK constraint names - when you created the FKs?

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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Creating multiple foreign key associations
« Reply #10 on: May 12, 2010, 09:27:22 pm »
Quote
How is it that you are all creating multiple foreign key constraints? Is there a work around or is it that nobody is really using this product for anything serious?

We are using EA for something serious: UML modelling, but not for database modelling, so I can't help you out here.

Geert

ScorpioTiger

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Creating multiple foreign key associations
« Reply #11 on: May 12, 2010, 11:48:26 pm »
Quote
Did you ensure you used DIFFERENT FK constraint names - when you created the FKs?

Paolo

Yes. I tried using different names. I even had a strange situation where I deleted all associations between the two entities concerned and created a new one only to have EA tell me that a constraint with that name already existed..!

I'll try a few more things, but at some point I'm going to have to give up and go to a different tool.

Thanks for the feedback.


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Creating multiple foreign key associations
« Reply #12 on: May 12, 2010, 11:57:06 pm »
Ah, are you sure you are deleting the relations? or just removing them from the diagram.
Use Ctrl-Del to "really" delete a relation.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Creating multiple foreign key associations
« Reply #13 on: May 13, 2010, 12:26:07 am »
Quote
Ah, are you sure you are deleting the relations? or just removing them from the diagram.
Use Ctrl-Del to "really" delete a relation.

Geert
To make sure you've got them ALL; use Visible Relations [Ctrl+Shift+I] to make them all visible first...

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

ScorpioTiger

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Creating multiple foreign key associations
« Reply #14 on: May 13, 2010, 06:33:01 am »
Quote
Ah, are you sure you are deleting the relations? or just removing them from the diagram.
Use Ctrl-Del to "really" delete a relation.

Geert

Definately deleting them. I haven't changed any default settings for warning dialogues, so when I hit delete, I get prompted to delete or hide the association...I've been selecting delete.

I'll try again tommorow, but I really can't afford to be wasting too much time on it. I might have to take what DDL it generates and reverse engineer it into another modeling tool.

I can't believe that others have not had the same issue.