hibernate之集合映射

写两种用的比较多的

1.    set映射

<set name="bars">

    <key column="foo_id"/>

    <one-to-many class="org.hibernate.Bar"/>

</set>

2.list映射

    <list name="teachers" table="t_tea_stu" cascade="save-update">

           <key column="sid"></key>

           <index column="stu_index"></index>

           <many-to-many class="Teacher" column="tid"></many-to-many>

     </list> 

posted @ 2013-02-05 11:24  虎猫  阅读(107)  评论(0编辑  收藏  举报