1
假設我有以下table
,由Eclipselink
生成。結合Derby:批量導入未設置AUTO_INCREMENT
1,"admin_","[email protected]"
2,"user_","[email protected]"
3,"user_","[email protected]"
進口是成功的,使用從ij tool
與Apache
SYSCS_UTIL.SYCS_IMPORT_TABLE()
:
CREATE TABLE "ACCOUNT" ("ID" BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), "DTYPE" VARCHAR(31), "EMAIL" VARCHAR(255));
接下來,我將導入散裝從一個文件,含有。
接下來我將通過JPA2
創建一個用戶。這導致:
Caused by: org.apache.derby.client.am.SqlException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL130406103359120' defined on 'ACCOUNT'.
沒有運行導入我可以創建一個用戶就好了。在我看來,導入不考慮表中指定的AUTO_INCREMENT
函數。我不應該使用ALTER TABLE ACCOUNT AUTO_INCREMENT = 4;
更新AUTO_INCREMENT
到4
,我應該嗎?
嗯ok了,太糟糕了,這是不是功能的一部分。儘管我在這方面的理解應該在許多情況下有所不同。感謝您的文檔鏈接! – Aquillo 2013-04-06 20:29:41