stickfigure
stickfigure

Reputation: 13556

Is it possible to upsert using jOOQ-generated record classes?

I can perform an insertInto().onDuplicateKeyUpdate() if I want to write my insert manually using the DSL, but is there an equivalent on the generated Record class?

Upvotes: 5

Views: 1196

Answers (1)

Lukas Eder
Lukas Eder

Reputation: 221106

As of jOOQ 3.7, this is not yet possible out of the box. There's a pending feature request for this: #2961.

Alternatively, you can write a utility that translates an UpdatableRecord into a corresponding INSERT .. ON DUPLICATE KEY UPDATE statement. All the meta information needed for this is available from the UpdatableRecord:

Upvotes: 1

Related Questions