ORA-02289: 序列(号)不存在
大家下午好!小弟我遇到一个老问题ORA-02289: 序列(号)不存在,请帮忙解决
sequence: seq_auto_ScenicSpotID是在test用户名下建的
create sequence seq_auto_ScenicSpotID start with 1 increment by 1;
在sqlplus下执行下面语句,插入成功!
insert into TB_ScenicSpot values(seq_auto_ScenicSpotID.nextval,'桂林');
那证明sequence seq_auto_ScenicSpotID 创建成功!
但在程序往数据库中插入数据时却报 “序列(号)不存在”!
我是用的hibernate插入的,以下是配置文件的部分代码:
<hibernate-mapping>
<class name="com.antrip.scenicspot.entity.TbScenicspot" table="TB_SCENICSPOT" schema="antrip">
<id name="scenicspotId" type="java.lang.Long">
<column name="SCENICSPOT_ID" precision="22" scale="0" />
<generator class="sequence" />
</id>
......
补充:在程序中我也是用的用户名test连接数据库的,
还有一个问题:scenicspotId是如何与sequence seq_auto_ScenicSpotID 关联的,这需要配置的吗?
scenicspotId为什么不会关联其它的sequence?
谢谢哦,