1.一对多 一对多是站在多的一方中映射xml中来分析的,比如:teacher.hbm.xml <set name="student" inverse="false" lazy="false" cascade="all-delete-orphan" order-by="resourceId"> <key> <column name="teacher_id"></column> </key> <one-to-many class="org.onetomany.Student/> </set> 2.多对一 多对一是站在多的一方中映射xml中来分析的,比如:student.hbm.xml <many-to-one name="teacher" class="org.onetomany.Teacher"> <column name="teacher_id"></column> </many-to-one> 3.一对一 <one-to-one name="student" class="org.onetoone.Student" cascade="all"/> <one-to-one name="teacher" class="org.onetoone.Teacher" cascade="all"/>