Difference Between One-to-Many, Many-to-One and Many-to-Many?

后端 未结 8 2051
孤城傲影
孤城傲影 2020-11-28 17:39

Ok so this is probably a trivial question but I\'m having trouble visualizing and understanding the differences and when to use each. I\'m also a little unclear as to how co

8条回答
  •  感动是毒
    2020-11-28 18:08

    1) The circles are Entities/POJOs/Beans

    2) deg is an abbreviation for degree as in graphs (number of edges)

    PK=Primary key, FK=Foreign key

    Note the contradiction between the degree and the name of the side. Many corresponds to degree=1 while One corresponds to degree >1.

    Illustration of one-to-many many-to-one

提交回复
热议问题