映射文件只要是一个XML格式文件就可以.名字任意.
- 通常情况下名称规范:
- 实体类名称.hbm.xml
引入约束: - hibernate3.jar/org.hibernate.hibernate-mapping-3.0.dtd
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="cn.itcast.hibernate3.demo1.Customer" table="customer">
<id name="id" column="id">
<generator class="native"/>
</id>
<property name="name" column="name" type="string"/>
<property name="age" column="age"/>
</class>
</hibernate-mapping>