Class Enrollment

java.lang.Object
com.ericbouchut.learndev.course.entity.Enrollment

@Entity public class Enrollment extends Object
Join entity linking a student to a course they joined, with state of its own (status and transition timestamps), which is why the association is an entity rather than a bare @ManyToMany like user_roles.

@MapsId reuses the embedded id's columns for the two associations, so the entity exposes real User and Course references while the primary key stays the (user, course) pair.

  • Constructor Details

    • Enrollment

      public Enrollment(User user, Course course)