1. 程式人生 > >Hibernate 的UserInfo.hbm.xml配置

Hibernate 的UserInfo.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">
<hibernate-mapping package="com.gxa.bj.model" >
   <class name="UserInfo" table="UserInfo">
        <!-- 主鍵生成策略 -->

        <id name="userId" type="java.lang.Integer">
            <!-- 資料庫列的型別 -->
            <column name="userId"></column>
            <!-- 如何生成ID號 -->
            <generator class="sequence">
                <param name="sequence">usernext</param>
            </generator>


        </id>
        <property name="userPwd" column="userPwd"></property>
        <property name="userName" column="userName"></property>
        <property name="regReason" column="REGREASON"></property>
        <property name="userAddress" column="userAddress"></property>
        <property name="userEmail" column="userEmail"></property>
    </class>
</hibernate-mapping>