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

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 or null, if the record was never in the database.
  • Record.changed(Field): The "changed" flag, indicating if the value was ever changed through the Record API. This is used 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:

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.

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo