假设我有以下内容table
,由Eclipselink
.
CREATE TABLE "ACCOUNT" ("ID" BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), "DTYPE" VARCHAR(31), "EMAIL" VARCHAR(255));
接下来我将从一个文件中批量导入,其中包含:
1,"admin_","myemail@domain.com"
2,"user_","anotheremail@domain.com"
3,"user_","yetanotherone@domain.com"
导入成功,使用ij tool
fromApache
和SYSCS_UTIL.SYCS_IMPORT_TABLE()
.
接下来我将通过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
表中指定的功能。我不需要更新AUTO_INCREMENT
到4
using ALTER TABLE ACCOUNT AUTO_INCREMENT = 4;
,对吗?