165
Views
2
Comments
Parent and child entity
Application Type
Reactive

how to identify which entity is child and which is parent...as in Movie OSMDb reactive web application we created a relation between Movie and MovieGenre .....Every movie should have a genre and different movies can have same genre.

How we can know Movie is child or parent entity.

2018-10-29 08-31-03
João Marques
 
MVP

Hi Eshita,


You seem to be describing a many-to-many relationship, where a movie can have multiple genres and the same genre can be present in multiple movies.

To support this scenario, there is no child nor parent relationship but a junction table that holds the relationship between genres and movies, something like the MovieGenre entity in my example below having a foreign key for the Movie and another foreign key for the Genre entities:


You can read more about creating many to many relationships in OutSystems here.


Hope it helps.


Cheers,
João

2023-10-16 05-50-48
Shingo Lam

Agree with João!

The theory is that:

  • there are entity A and entity B
  • each entity A has 1 reference to entity B
  • each entity B has 1 reference to entity A

In summary, it calls many to many relationship, you should add 1 more entity to keep the 2 attributes for a relationship between A and B. The example is mentioned in the answer above

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.