一,持久類對象XML配置
<?xml version="1.0" encoding="UTF-8"?> <!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="com.aaa.bean.User" table="user"> <id name="uid">
<--如果uid類型是字符串類型的話就用uuid--> <generator class="native"/> </id>
<!-- <property name="user_code" column="user_code"/>持久類的字段名與表名字段相同時可以省略column屬性,默認與name相同 --> <property name="user_code"/> <property name="user_name"/> <property name="user_password"/> <property name="user_state"/>
</class> </hibernate-mapping>