CRUD
Besides the awesome DSL-fluent API for expressing complex SQL, jOOQ can be used to express everyday SQL operations as well. These are known as CRUD operations (Create (INSERT
), Read (SELECT
), Update (UPDATE
), and Delete (DELETE
)), and jOOQ facilitates them via a dedicated API that involves UpdatableRecord
types. In other words, the jOOQ Code Generator generates a UpdatableRecord
(a record that can be fetched and stored again in the database) for each table that has a primary key (not just a simple unique key!). Tables without a primary key (org.jooq.TableRecord
) are rightly considered non-updatable by jOOQ. You can easily recognize a jOOQ UpdatableRecord
because it has to extend the UpdatableRecordImpl
class (simply inspect your generated records from jooq.generated.tables.records
). Next, jOOQ exposes a CRUD API that allows you to operate directly on these updatable records instead of writing DSL-fluent queries (which fits better for complex queries that involve more than one...