From e4ed930fd76450dde61011cabaa4e206283a6872 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Sun, 9 Dec 2012 22:33:28 +0100 Subject: [PATCH] [#1995] Record.original() values aren't updated after a Record.store() operation --- jOOQ-test/src/org/jooq/test/_/testcases/CRUDTests.java | 10 ++++++++++ jOOQ/src/main/java/org/jooq/impl/Value.java | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/jOOQ-test/src/org/jooq/test/_/testcases/CRUDTests.java b/jOOQ-test/src/org/jooq/test/_/testcases/CRUDTests.java index 49407b12ce..67db214dcd 100644 --- a/jOOQ-test/src/org/jooq/test/_/testcases/CRUDTests.java +++ b/jOOQ-test/src/org/jooq/test/_/testcases/CRUDTests.java @@ -39,6 +39,7 @@ import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertNull; +import static junit.framework.Assert.assertTrue; import static junit.framework.Assert.fail; import static org.jooq.SQLDialect.SQLITE; import static org.jooq.impl.Factory.count; @@ -375,9 +376,18 @@ extends BaseTest implements Serializable { * Generated UID */ private static final long serialVersionUID = -9065797545428164533L; - private final T original; + private T original; private T value; private boolean isChanged; @@ -106,6 +106,12 @@ class Value implements Serializable { final void setChanged(boolean isChanged) { this.isChanged = isChanged; + + // [#1995] If a value is meant to be "unchanged", the "original" should + // match the supposedly "unchanged" value. + if (!isChanged) { + original = value; + } } // ------------------------------------------------------------------------