Hibernate主键使用序列的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="com.feapp.framework.dbcommon.sysmanagement.model.LimitedManagement" table="FE1_AUTHORITY_INFO" schema="RISK">

        /////////主键为oracle序列。。保存无需设置
        <id name="anthorityId" type="java.lang.Long">
            <column name="ANTHORITY_ID" precision="22" scale="0" />
            <generator class="sequence">
             <param name="sequence">SYSTEM_MANAGE_SEQ</param>
            </generator>
        </id>
        <property name="authorityName" type="java.lang.String">
            <column name="AUTHORITY_NAME" length="100" not-null="true" />
        </property>
        <property name="authorityDes" type="java.lang.String">
            <column name="AUTHORITY_DES" length="200" />
        </property>
        <property name="isLeaf" type="java.lang.String">
            <column name="IS_LEAF" length="2" />
        </property>
        <property name="fatherId" type="java.lang.Long">
            <column name="FATHER_ID" precision="22" scale="0" />
        </property>
        <property name="url" type="java.lang.String">
            <column name="URL" length="400" />
        </property>
        <property name="odr" type="java.lang.Long">
            <column name="ODR" precision="22" scale="0" />
        </property>
        <property name="icon" type="java.lang.String">
            <column name="ICON" length="400" />
        </property>
    </class>
</hibernate-mapping>

你可能感兴趣的:(java,oracle,Hibernate,xml,MyEclipse)