name(实例化类名).hbm.xml文件案例

[html] view plain copy

 print?
<span xmlns="http://www.w3.org/1999/xhtml"><?xml version="1.0"?>  
  
<!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.bzu.hibernate.Student" table="student">  
  
        <id name="id" column="id" type="string">  
  
            <generator class="uuid"></generator>  
  
        </id>  
  
        <property name="name" column="name" type="string"></property>  
  
        <property  name="cardId"     column="cardId"type="string"></property>  
  
        <property name="age" column="age" type="int"></property>  
  
        <set name="courses" table="student_course" cascade="save-update">  
  
            <key column="stu_id"></key>  
  
            <many-to-many class="com.bzu.hibernate.Course" column="course_id">  
  
            </many-to-many>  
  
        </set>  
  
    </class>  
  
</hibernate-mapping></span> 

 

posted @ 2017-03-03 14:50  易小川  阅读(251)  评论(0编辑  收藏  举报