不知道能不能设置,学习下^-^
但是你可以自己写个字段自增长的程序,不一定要在hibernate中配置

解决方案 »

  1.   

    http://java.ccidnet.com/art/3741/20030114/544057_1.html
    搜到这个看看
      

  2.   

    哈哈,这个时候就显出Oracle的功力了
      

  3.   

    有个问题问一下楼主:为什么要把username作为主键?没听说过,一般都是ID作为主键的
      

  4.   

    你是不是在添加或删除的时候报这个错
    当 IDENTITY_INSERT 设置为 OFF 时,不能为表 'OA_AJ' 中的标识列插入显式值。是的话只要自动增长列的<property> 节点里添加 update="false" insert="false" 应该就可以了id name="userName" type="java.lang.String">
        <column name="user_name" length="30" />
        <generator class="assigned"></generator>
    </id>
    <property name="userId" type="java.lang.Long" update="false" insert="false">
        <column name="user_id" precision="18" scale="0" not-null="true" />
    </property>