Difference between one-to-many and many-to-one relationship

后端 未结 11 520
心在旅途
心在旅途 2020-12-12 10:52

What is the real difference between one-to-many and many-to-one relationship? It is only reversed, kind of?

I can\'t find any \'good-and-easy-to-understand\' tutoria

11条回答
  •  不知归路
    2020-12-12 11:43

    One-to-Many and Many-to-One are similar in Multiplicity but not Aspect (i.e. Directionality).

    The mapping of Associations between entity classes and the Relationships between tables. There are two categories of Relationships:

    1. Multiplicity (ER term: cardinality)
      • One-to-one relationships: Example Husband and Wife
      • One-to-Many relationships: Example Mother and Children
      • Many-to-Many relationships: Example Student and Subject
    2. Directionality : Not affect on mapping but makes difference on how we can access data.
      • Uni-directional relationships: A relationship field or property that refers to the other entity.
      • Bi-directional relationships: Each entity has a relationship field or property that refers to the other entity.

提交回复
热议问题