4

I am using DIA v0.97.1 to draw an entity relationship diagram with UML sheet for my database model. However, I tried and failed to find a switch allowing me to add cardinality notations (e.g. 1...n) on those relationship lines. Is there such a feature in Dia? Or I have to install some plug-ins? Thanks.

Frank Huang
  • 55
  • 1
  • 3

1 Answers1

7

the cardinality of relationships is set inside the relationship box. double click it to find its properties. first three properties are name, left cardinality and right cardinality :) this way they remain locked to the relationship box and not the line. which actually makes more sense.

also, make sure you're using the model sheet "er", and not "uml", since the "uml"-sheet lacks the relationship box. "er" only has 5 thingies, but they're really all one needs for er diagrams.

davogotland
  • 2,718
  • 1
  • 15
  • 19
  • Thanks davogotland. I got it! – Frank Huang Jan 13 '12 at 03:16
  • Hi davogotland, I tried the "ER" sheet. However, I found that the "Entity" box does not allow me to put all the attributes into it. I had to use "Class" box in "UML" sheet to do that. Is it supposed to be this way or is it me who overlooked some important feature of it? Could you please also recommend a tutorial dedicated to the UML or ER sheets of DIA in database modeling? Thanks a lot! – Frank Huang Jan 13 '12 at 03:20
  • At least now, it seems to me that both ER and UML sheet have some desired feature which I cannot miss. Is it the way it is? Or it is me that misunderstands it? A little puzzled. – Frank Huang Jan 13 '12 at 03:23
  • in an er diagram, the entity boxes hold only the entity names. attributes are separated into small bubbles that hover around the entity bound by a line :) like this: http://www.sparxsystems.com/enterprise_architect_user_guide/images/entity%20relationship%20diagram.png underlined names in attributes are primary keys, double circle is many (effectively leading to a "one to many relationship"), double square around an entity means that it's weak (can only be identified if a parent is known). and foreign keys are never written in the er diagram. that stuff is for the physical diagram. – davogotland Jan 13 '12 at 03:44
  • Thank you very much davogotland! I wish there were a way to give you a lot of points for your detailed explanation! – Frank Huang Jan 13 '12 at 07:12
  • Another thing though, do those Dia2sql tools work with ERD the same way as working with UML? I mean can they help you automatically translate the database model you drew in the diagram with Dia into SQL statements, no matter what sheet you are using? Or they only work if your database model is drawn with UML sheet? I think that feature is pretty important. – Frank Huang Jan 13 '12 at 07:16
  • @FrankHuang you're welcome! click the up arrow over the zero in the upper left corner of the question, that'll give me 10 points :) i don't know about generating code, i never do that myself. for me the diagram is only about thinking + conveying my thoughts to others. – davogotland Jan 13 '12 at 09:40
  • 1
    Hi davogotland I just tried vote up but it says "vote up requires 15 reputation". I will work on accumulating my reputation these days and try then. In the mean time, I will highly appreciate any thoughts on code generating... – Frank Huang Jan 13 '12 at 13:14
  • Not getting the idea about "ER" relationship node... On "ER" relationship node, there is an option to define of so called "cardinality". – micrub Mar 20 '17 at 20:49