In jOOQ 1.6.1, changing the value of a primary key field on an
existing record results in a new insert.
Record from my 'ledger' table, primary key is on column 'code':
code | description
------+---------------------------------------
M1 | test description
This works OK:
record.setDescription("blabla");
record.store();
PostgreSQL log:
update "public"."ledger" set "description" = $1 where
"public"."ledger"."code" = $2
parameters: $1 = 'blabla', $2 = 'M1'
This doesn't:
record.setCode("test");
record.store();
PostgreSQL log:
insert into "public"."ledger" ("code", "description") values ($1, $2)
parameters: $1 = 'test', $2 = 'blabla'
Is this a bug or a feature? :)