獲取不當序列值,同時使用Hibernate插入記錄不正確的序列值,序列。爲什麼它正在發生獲取在Oracle 10g
CREATE TABLE "DOCTOR"
( "DOCTOR_ID" NUMBER(10,0) NOT NULL ENABLE,
"DOCTOR_NAME" VARCHAR2(40),
"PLACE" VARCHAR2(40),
"PHONE_NUMBER" NUMBER(10,0),
CONSTRAINT "DOCTOR_PK" PRIMARY KEY ("DOCTOR_ID") ENABLE
)
/
CREATE OR REPLACE TRIGGER "BI_DOCTOR"
before insert on "DOCTOR"
for each row
begin
select "DOCTOR_SEQ1".nextval into :NEW.DOCTOR_ID from dual;
end;
/
ALTER TRIGGER "BI_DOCTOR" ENABLE
DOCTOR_SEQ1:
Min Value 1
Max Value 999999999999999999999999999
Increment By 1
Cycle Flag N
Order Flag N
Cache Size 20
Last Number 261
和配置爲休眠
hbm:
<id name="doctorId" type="long">
<column name="DOCTOR_ID" precision="10" scale="0" />
<generator class="sequence" >
<param name="sequence">DOCTOR_SEQ1</param>
</generator>
</id>
obtained values
245 ramesh knr 8080808080
243 chakri hyd 9090909090
247 rameshreddy knr 8080808080
任何幫助遞增2值將不勝感激
你可以發佈你獲得的序列值嗎? –