I'm following the tutorial here:
For example, if I am a teacher, I can teach 0-many grades. I see three records:
The Teacher would have a Id, Name, and an IList<TeacherGradeRecord> property called Grades
The GradeRecord would have an Id, Name property
The TeacherGradeRecord would have an Id, TeacherRecord, and GradeRecord
According to the tutorial, at least as far as I could tell, when I save my teacher using _teacherRepository.Create(teacher) I also have to manually save each TeacherGradeRecord to the database, so _teacherGradeRepository.Create(teacher,grade).
I have this all working. The teacher gets created, the TeacherGradeRecord gets inserted into the database.
Where I'm at now is that when I call _teacherRepository.Get(teacherId), the Grades property on teacher isn't populated. I thought NHibernate was supposed to pull those automatically...
First things first, can someone tell me if I have the jist of how N-N is supposed to work correct?