diff --git a/jOOQ-test/src/org/jooq/test/_/testcases/RecordTests.java b/jOOQ-test/src/org/jooq/test/_/testcases/RecordTests.java index f8565dc077..645634f1f7 100644 --- a/jOOQ-test/src/org/jooq/test/_/testcases/RecordTests.java +++ b/jOOQ-test/src/org/jooq/test/_/testcases/RecordTests.java @@ -122,5 +122,27 @@ extends BaseTest + * If the changed argument is false, the + * {@link #original()} values will be reset to the corresponding "current" + * values as well + * + * @see #changed() + * @see #changed(boolean, Field) + * @see #changed(boolean, int) + * @see #changed(boolean, String) + */ + void changed(boolean changed); + + /** + * Set this record's internal changed flag to the supplied value for a given + * field. + *

+ * If the changed argument is false, the + * {@link #original(Field)} value will be reset to the corresponding + * "current" value as well + * + * @see #changed() + * @see #changed(Field) + */ + void changed(boolean changed, Field field); + + /** + * Set this record's internal changed flag to the supplied value for a given + * field. + *

+ * If the changed argument is false, the + * {@link #original(int)} value will be reset to the corresponding "current" + * value as well + * + * @see #changed() + * @see #changed(int) + */ + void changed(boolean changed, int fieldIndex); + + /** + * Set this record's internal changed flag to the supplied value for a given + * field. + *

+ * If the changed argument is false, the + * {@link #original(String)} value will be reset to the corresponding + * "current" value as well + * + * @see #changed() + * @see #changed(String) + */ + void changed(boolean changed, String fieldName); + /** * Convert this record into an array. *

diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractRecord.java b/jOOQ/src/main/java/org/jooq/impl/AbstractRecord.java index 09a3e41a79..5ad90bdae4 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractRecord.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractRecord.java @@ -400,6 +400,28 @@ abstract class AbstractRecord extends AbstractStore implements Record { return changed(getIndex(fieldName)); } + @Override + public final void changed(boolean changed) { + for (Value value : getValues()) { + value.setChanged(changed); + } + } + + @Override + public final void changed(boolean changed, Field field) { + changed(changed, getIndex(field)); + } + + @Override + public final void changed(boolean changed, int fieldIndex) { + getValue0(fieldIndex).setChanged(changed); + } + + @Override + public final void changed(boolean changed, String fieldName) { + changed(changed, getIndex(fieldName)); + } + @Override public final Object[] intoArray() { return into(Object[].class);