I am new to hibernate and just recently i started looking in to the tutorial on it at
http://docs.jboss.org/hibernate. So please bear with me.
I have a database tables Patient, Hospital and PatientHospital. My classes look somthing like this.
Patient { id (PK), firstname, lastname}
Hospital {id(PK), name, address}
PatientHospital{hospitalId (PK), patientId, recordNumber}
This is a many-to-many mapping. I am trying to map this on hibernate but have not been successful.
Do we need to create a hibernate mapping xml for PatientHospital as well?
Can anyone please help me out with the hibernate mapping? Thanks in advance.