java - @GenerationType.IDENTITY failing above 10 -
i'm working in project need store data (among other things, of course). production db mysql tests i'm using hypersql (aka hsqldb).
all @enitity
classes has corresponding @id
field @generatedvalue(strategy = generationtype.identity)
let db generate field. working fine until tried load amount of data in hsqldb , got error:
java.sql.sqlintegrityconstraintviolationexception: violación del restricción de integridad: violación de índice o clave única; uk_... table: operacion
the message "violación del restricción de integridad: violación de índice o clave única" means "integrity constraint violation: primary key or unique index violation" (i don't know if that's message when locale set english, translation that)
i set logger trace
full picture , realized in table operacion
generates id
field 10 no problem, in 11th registry gives me message sqlexceptionhelper:139 - not execute statement [n/a]
, raises exception.
is there way configure hsqldb
generates more @id
values identity
? @generationtype.identity
strategy or db itself? there issue chosen strategy must take account in production environment?
thanks in advance answers.
edit #1
i've been swimming in hypersql documentation , in last version (and previous also) supports identity generation. in case, switched last version 2.3.4
(i using 2.3.2
) result same.
also tried @generationtype.auto
strategy error remains. maybe there's configuration can use in persistence.xml
tell hsqldb how many identities must generate still don't find anything. if knows property please let me know.
could please check table contains record has primary key=10? can delete records table , run program? think table contains record pk=10.
Comments
Post a Comment