0 0

ORA-02289: 序列不存在3

插数据的时候报:
Hibernate: select H_shop_ID.nextval from dual
Hibernate: insert into H_shop (shopname, town, password, chinaname, englishname, shopnum, address, phone, fax, email, contacter, mobile, website, description, picurl, status, createtime, updatetime, provinceid, cityid, shopTypeid, smallTypeid, advertise_url, shoppic1, shoppic2, shoppic3, shoppic4, count_ding, count_cai, ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2010-12-02 14:09:21 [org.hibernate.util.JDBCExceptionReporter]-[ERROR] ORA-02289: 序列不存在
2010-12-02 14:09:21 [org.hibernate.event.def.AbstractFlushingEventListener]-[ERROR] Could not synchronize database state with session

已经重置sequence,还是插入不了

问题补充:
andy_javahome 写道
在数据库里执行一个sequence
create sequence user_seq
  increment by 1
  start with 100000000
  nomaxvalue
  nocycle
  nocache;

<id name="id" type="java.lang.Long">
            <column name="ID" precision="10" scale="0" />
            <generator class="sequence" >
               <param name="sequence">user_seq</param>
            </generator>
        </id>

你是这样做的吗。


我是这样写的:<id name="id" column="ID" type="long">
<generator class="sequence">
<param name="sequence">H_shop_ID</param>
</generator>
</id>

问题补充:
andy_javahome 写道
把对应的列加上啊
<column name="ID" precision="10" scale="0" />



precision和scale是精密度和数值范围,我加了没用
2010年12月02日 14:08

3个答案 按时间排序 按投票排序

0 0

采纳的答案

你确定数据库创建了H_shop_ID吗,我把我数据库创建的sequence删了和你抱的错一样。

2010年12月02日 17:06
0 0

把对应的列加上啊
<column name="ID" precision="10" scale="0" />

2010年12月02日 16:30
0 0

在数据库里执行一个sequence
create sequence user_seq
  increment by 1
  start with 100000000
  nomaxvalue
  nocycle
  nocache;

<id name="id" type="java.lang.Long">
            <column name="ID" precision="10" scale="0" />
            <generator class="sequence" >
               <param name="sequence">user_seq</param>
            </generator>
        </id>

你是这样做的吗。

2010年12月02日 14:58

相关推荐

Global site tag (gtag.js) - Google Analytics