← 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?
- A.@ManyToMany doesn't exist in JPA
- B.The join entity can hold extra data like enrolment date or grade
- C.It uses fewer tables
- 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 →