OneToMany 中间表关联
Class
@Testpublic void testOneToManyJoinTable() {session.beginTransaction();OneToMany.joinTable.Class c = new OneToMany.joinTable.Class();c.setClassName("classNmae");OneToMany.joinTable.Student s1 = new OneToMany.joinTable.Student();OneToMany.joinTable.Student s2 = new OneToMany.joinTable.Student();OneToMany.joinTable.Student s3 = new OneToMany.joinTable.Student();s1.setStudentName("s1");s2.setStudentName("s1");s3.setStudentName("s1");c.getStudents().add(s3);c.getStudents().add(s2);c.getStudents().add(s1);s3.setMyclass(c);s2.setMyclass(c);s1.setMyclass(c);session.save(c);session.getTransaction().commit();}?