Module org.jooq
Package org.jooq

Interface UpdatableRecord<R extends UpdatableRecord<R>>

Type Parameters:
R - The record type
All Superinterfaces:
Attachable, Comparable<Record>, Fields, Formattable, QualifiedRecord<R>, Record, Serializable, SQLData, TableRecord<R>
All Known Implementing Classes:

public interface UpdatableRecord<R extends UpdatableRecord<R>> extends TableRecord<R>
A common interface for records that can be stored back to the database again.

Any Record can be updatable, if

  1. it represents a record from a table or view - a TableRecord
  2. its underlying table or view has a "main unique key", i.e. a primary key or at least one unique key

The "main unique key" is used by jOOQ to perform the various operations that can be performed on an UpdatableRecord:

  • delete() : Deleting the record
  • refresh() : Refreshing the records attributes (or loading it for the first time)
  • store() : Storing the record to the database. This executes either an INSERT or an UPDATE statement
  • merge() : Merging a record to the database. This executes an INSERT … ON DUPLICATE KEY UPDATE statement.

UpdatableRecords are Attachable, which means that they hold an underlying Configuration that they can be detached from. They can also be instantiated without any underlying Configuration, in case of which they have to be attached first, in order to be refreshed, stored, or deleted.

Lukas Eder