Sparx Systems Forum

Enterprise Architect => Bugs and Issues => Topic started by: Modesto Vega on April 17, 2015, 06:37:38 pm

Title: Cardinality between database objects
Post by: Modesto Vega on April 17, 2015, 06:37:38 pm
I have 2 tables, A and B. Table A has a primary key defined, lets call it PKa and table B has no primary key defined and a foreign key to table A, lets call it FKa. I have a foreign key constraint constrain between the 2 tables, lets call it FKa_b.

I cannot set the cardinality of FKa_b to 1..1/1..*, this is to signify that 1 and only 1 row in table A can have 1 or many rows in table B. Each time I try it EA changes it to 1..1/0...*. In fact, it does not even allow me to create a 1/1..* relationship but it has no problems with a 1/0..*.


What have I missed?

P.S.: I have moved this post from the general board. Currently running EA 12 build (1212) and the problem is still there.
Title: Re: Cardinality between database objects
Post by: Modesto Vega on April 21, 2015, 06:55:56 pm
I have not had a reply to this. This is a serious problem, so serious that I am starting to doubt EA's database modelling capabilities.

An Order can have 1 or more items in it, if it has no items there is no order. EA does let me create a relationship between an Order table and an Oder Line Item table with a cardinality of 1/1..*.
Title: Re: Cardinality between database objects
Post by: qwerty on April 21, 2015, 08:07:49 pm
Too long ago I used EA for DB modeling. But EA is not really a DB design tool like say Erwin. It's an UML modeling tool that can be used for DB engineering. There is a product from Sparx Japan which supports this DB modeling task more. Can't recall the name but you'll likely will find it...

q.
Title: Re: Cardinality between database objects
Post by: skiwi on April 22, 2015, 10:57:41 am
(http://i306.photobucket.com/albums/nn245/copperkiwi/Sparx/ForeignKeyCardinality_zpsxg9byz0f.png)
Title: Re: Cardinality between database objects
Post by: Modesto Vega on April 22, 2015, 05:48:45 pm
Quote
(http://i306.photobucket.com/albums/nn245/copperkiwi/Sparx/ForeignKeyCardinality_zpsxg9byz0f.png)
I can be ignorant and stupid but not that ignorant and stupid  ;). You can choose them but EA 12 (Build 1212) changes the selections as explained above.

Please read the thread. You can select them, the problem is that EA doesn't keep them.

Perhaps I should have been more precise with my explanation.
Title: Re: Cardinality between database objects
Post by: skiwi on May 06, 2015, 12:25:37 pm
Quote
[snip] There is a product from Sparx Japan which supports this DB modeling task more.
q.

http://www.dbmode.com/
Title: Re: Cardinality between database objects
Post by: skiwi on May 06, 2015, 12:27:55 pm
Quote
I can be ignorant and stupid but not that ignorant and stupid  ;)

Please read the thread. You can select them, the problem is that EA doesn't keep them.

Perhaps I should have been more precise with my explanation.

Good luck, perhaps someone else will be more motivated to help, given your response.
Title: Re: Cardinality between database objects
Post by: Modesto Vega on May 06, 2015, 08:20:40 pm
Quote

Good luck, perhaps someone else will be more motivated to help, given your response.
Luck I might need because I have not found an answer yet and this is starting to look like an EA bug.

I have established that EA12 is actually changing by selections after I click Ok or Apply. So there must be some "EA logic" driving this.

Thanks for the dbmode link. I'll give that a go.
Title: Re: Cardinality between database objects
Post by: skiwi on May 11, 2015, 02:17:50 pm
Worth putting in a bug report then, as much functionality has changed in this area.
Title: Re: Cardinality between database objects
Post by: Modesto Vega on May 13, 2015, 07:37:00 pm
Quote
Worth putting in a bug report then, as much functionality has changed in this area.
I will later on today.
Title: Re: Cardinality between database objects
Post by: benc on June 12, 2015, 02:11:38 pm
Hi Modesto,

I think this issue was resolved in Build 1213. The release notes for 1213 contain an entry like:
Quote
Foreign Key dialog now saves child cardinality

Can you please confirm that this addresses your concern?

I hope it helps.

Ben
Title: Re: Cardinality between database objects
Post by: Paolo F Cantoni on June 12, 2015, 06:25:19 pm
Quote
Hi Modesto,

I think this issue was resolved in Build 1213. The release notes for 1213 contain an entry like:
Quote
Foreign Key dialog now saves child cardinality

Can you please confirm that this addresses your concern?

I hope it helps.

Ben
Sometimes EA (and other tools) talk about cardinality and multiplicity - two related concepts.

UML talks mainly about Multiplicity.  So, what's the difference?

Multiplicity is how many there can be.  Cardinality is about how many there are...

Thus, when we are talking about Foreign Key Constraints etc, we are talking about multiplicity.  For a given row (which acts as a master for a number of related rows in another, oir the same, table) we talk about the cardinality of the row (under that particular relation).  So, for person parent-child relationship, the multiplicity is 0..* but the cardinality for me as a parent is 3 (since I have two sons and a daughter).

HTH,
Paolo

[RoyC - I think the doco is, occasionally, inconsistent on this]