One-to-Many Unidirectional Relationship

Learn how to implement one-to-many relationships and about the orphan removal attribute.

To show the one-to-many relationship, we will model the case where many players can register for a tournament. We will create a tournament table and a registration table to model this relationship.

Unidirectional one-to-many relationship means that only one side maintains the relationship details. So given a Tournament entity, we can find the Registrations but we cannot find the Tournament details from a Registration entity.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.