I have a problem with a database that I don't control.
The database was written so that two fields/columns in certain tables identify a unique item.
As an example, consider having a student table and a class participant table. Rather than linking to a student number in the class participant table it links to the first name and surname fields.
Student
Student number
First Name
Surname
Class Participants
Class ID
First Name
Surname
(Please don't get bogged down on why you would do it like this, just accept that it has been done)
What I need to do is create a relationship in the Students.hbm.xml and ClassParticipants.hbm.xml files and I'm not sure how to do this.
The relationship would be
one (Students)
to many (Class Participants)
Any ideas?