We have a requirement to add attributes to a JoinTable/link table. Consider we have a Student object and a Course object. Both of them are modeled as Hibernate entities with their respective tables. Now when a student (John) is assigned a course (English), we would like to add an attribute course-type (say "elective") for the STUDENT_COURSE link table that gets created.
We tried several annotations including JoinTable, SecondaryTable etc. But we could not get that to work. Can someone advise on how to implement this using Hibernate annotations? Is it possible in the first place?
thanks, Karunakar
|