7月8日 SSM 周日

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class name="com.sk.dto.Student" table="SK_STUDENT">
        <id name="id">
            <generator class="identity"/>
        </id>
        <property name="name"/>
        <property name="age"/>
        <property name="sex"/>
        <set name="kes" table="SK_STU_KE" lazy="false">     <!-- table:中间表 -->
            <key column="sss"/>         <!-- column:代表本类在中间表对应的字段 -->
            <many-to-many class="com.sk.dto.Ke" column="kkk"/>  <!-- column:代表对面类在中间表对应的字段 -->
        </set>
    </class>

    <class name="com.sk.dto.Ke" table="SK_KE">
        <id name="kid">
            <generator class="identity"/>
        </id>
        <property name="kname"/>
        <set name="students" table="SK_STU_KE" lazy="false">        <!-- table:中间表 -->
            <key column="kkk"/>         <!-- column:代表本类在中间表对应的字段 -->
            <many-to-many class="com.sk.dto.Student" column="sss"/> <!-- column:代表对面类在中间表对应的字段 -->
        </set>
    </class>

</hibernate-mapping>

我一直婉拒别人的情意,只为一个不确定的你
——庄心妍 《好可惜》

猜你喜欢

转载自blog.csdn.net/helloworld_1996/article/details/80962836