🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Relationships and Transactions: all 10 questions

Quiz: Relationships and Transactions · Question 4 of 10

Why model Student ↔ Course with an Enrollment entity instead of @ManyToMany?

Why model Student ↔ Course with an Enrollment entity instead of @ManyToMany?

  1. A.@ManyToMany doesn't exist in JPA
  2. B.The join entity can hold extra data like enrolment date or grade
  3. C.It uses fewer tables
  4. D.Hibernate can't map many-to-many
Answer & explanation

Correct answer: The join entity can hold extra data like enrolment date or grade

Real systems almost always need data on the relationship.

Can you get the rest right without peeking?

Take the timed Quiz: Relationships and Transactions quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →