hibernate正向生成数据库表以及配置——Student.hbm.xml

<?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">
<!-- 
    Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
    <class name="cn.bdqn.studentInfo.entity.Student" table="Student">
        <id name="id">
            <column name="ID"/>
            <generator class="assigned" />
        </id>
        <property name="name"> </property>
        <set name="teachers" table="teacher_student"  cascade="all">
            <key>
                <column name="studentId"  />
            </key>
            <many-to-many class="cn.bdqn.studentInfo.entity.Teacher" column="teacherId"/>
        </set>
    </class>
</hibernate-mapping>

posted @ 2017-02-27 22:40  穆雄雄  阅读(84)  评论(0编辑  收藏  举报