[#3359] store() after copy() executes an UPDATE instead of an INSERT, when Settings.updatablePrimaryKeys is set

This commit is contained in:
Lukas Eder 2014-06-27 13:58:34 +02:00
parent 3b2303b658
commit 088b5f1a25
2 changed files with 13 additions and 1 deletions

View File

@ -1168,6 +1168,15 @@ xxxxxx xxxxx xxxxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx xxxxxxxxxxxxx
xxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx xx x xxxxxxxxxx
xxxxxxxxxxxxx
xxxxxxxxxxxxxxxx
xxxxxxxxxxxxx
xxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx xxxxxxxxxxxx
xxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x
xxxxx

View File

@ -322,7 +322,10 @@ public class UpdatableRecordImpl<R extends UpdatableRecord<R>> extends TableReco
@Override
public final R copy() {
return Utils.newRecord(fetched, getTable(), configuration())
// [#3359] The "fetched" flag must be set to false to enforce INSERT statements on
// subsequent store() calls - when Settings.updatablePrimaryKeys is set.
return Utils.newRecord(false, getTable(), configuration())
.operate(new RecordOperation<R, RuntimeException>() {
@Override