Timestamp timestamp = addRecordTimestamp(insert);
private final int storeUpdate0(TableField<R, ?>[] keys) { UpdateQuery<R> update = create().updateQuery(getTable()); addChangedValues(update); Utils.addConditions(update, this, keys); // Don't store records if no value was set by client code if (!update.isExecutable()) return 0; // [#1596] Set timestamp and/or version columns to appropriate values BigInteger version = addRecordVersion(update); Timestamp timestamp = addRecordTimestamp(update); if (isExecuteWithOptimisticLocking()) { // [#1596] Add additional conditions for version and/or timestamp columns if (isTimestampOrVersionAvailable()) { addConditionForVersionAndTimestamp(update); } // [#1547] Try fetching the Record again first, and compare this // Record's original values with the ones in the database else { checkIfChanged(keys); } } // [#1596] Check if the record was really changed in the database int result = update.execute(); checkIfChanged(result, version, timestamp); if (result > 0) { changed(false); } return result; }
Timestamp timestamp = addRecordTimestamp(update);