Available in versions: Dev (3.22) | Latest (3.21) | 3.20 | 3.19 | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12
This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.
Record internal flags and dirty tracking
Supported by ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
All of jOOQ's Record types and subtypes maintain an internal state for every column value. This state is composed of three elements:
-
Record.get(Field): The value itself. -
Record.original(Field): The "original" value, i.e. the value as it was originally fetched from the database ornull, if the record was never in the database. -
Record.touched(Field): The "touched" flag, indicating if the value was ever touched (or modified) through theRecordAPI. This is used for dirty tracking. -
Record.modified(Field): The "modified" flag, indicating if the value was ever modified through theRecordAPI. This can be used as an alternative for dirty tracking.
An additional operation is available on records in order to reset a value to its original, as well as to reset the touched or changed flag:
-
Record.reset(Field): Reset the value to its "original" value.
The purpose of the above information is for jOOQ's CRUD operations to know, which values need to be stored back to the database, and which values have been left untouched or unmodified, respectively.
Feedback
Do you have any feedback about this page? We'd love to hear it!