Available in versions: Dev (3.20) | Latest (3.19) | 3.18 | 3.17 | 3.16

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.

Readonly columns

Applies to ❌ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

jOOQ's code generator may decide that a column is readonly, in case of which using it in various DML statements may change. By default, INSERT, or UPDATE operations on such columns are simply ignored.

INSERT INTO
  MY_TABLE (ID) -- READONLY_COLUMN is ignored
VALUES
  (1);
create.insertInto(MY_TABLE)
      .columns(MY_TABLE.ID, MY_TABLE.READONLY_COLUMN)
      .values(1, 1)
      .execute();

This also affects any UpdatableRecord call:

INSERT INTO
  MY_TABLE (ID) -- READONLY_COLUMN is ignored
VALUES
  (1);
MyTableRecord rec = create.newRecord(MY_TABLE);
rec.setId(1);
rec.setReadonlyColumn(1);
rec.store();

The default behaviour of readonly columns in INSERT and UPDATE statements can be overridden with these 4 readonly settings:

For more details about the settings, refer to the page about readonly settings

Feedback

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

The jOOQ Logo