Hello Ryan,
> Is there any way to clear the changed() flag in an UpdateableRecord ?.
Right now, without reflection or other tricks, you cannot do it. Of
course, you could mimick JDBC Connection, PreparedStatement, etc,
attach your record to such a Configuration, and store() the record.
But that would still be a trick.
> I have a few cases where for instance I am doing a record.from() and I know
> the documentation says it sets the changed flag, but I would like to
> manually then reset it. Resetting would imply that the original() values are
> also set to the same value.
Yes. changed() and original() should be "in-sync". #1995 is a related
issue, where this is fixed:
https://github.com/jOOQ/jOOQ/issues/1995
> Not sure how to implement this in a neat way? because I guess you are really
> trying to hide the implementation.
I no longer am. Since this flag (and the original values) are now
exposed in a useful public API, I don't see a good reason why I
shouldn't also add setters for the changed flag. So, the API in jOOQ
3.0 might look like this:
// Getter added in jOOQ 2.6
boolean changed()
// Getters added in jOOQ 3.0
boolean changed(Field<?>)
boolean changed(int)
boolean changed(String)
// Setters to be added in jOOQ 3.0. If the boolean argument is false,
the "original" value will be set to the "current" value as well
void changed(boolean)
void changed(boolean, Field<?>)
void changed(boolean, int)
void changed(boolean, String)
This is now ticket #1999:
https://github.com/jOOQ/jOOQ/issues/1999
I'm also wondering if I should plan for a release 2.7, merging some of
jOOQ 3.0's minor API improvements for early access. These changed()
getters/setters would be included, then
Cheers
Lukas