jaideep
jaideep

Reputation: 1631

How to delete different updatable records in one shot?

How to delete List of different tablerecords from a single query in JOOQ? Is this possible with JOOQ API? Or i have to delete record one by one ,Just get one record fire query and so on?

For Ex: I have two records of different tables Like :

MyTableRecord1 and MyTableRecord2

I want to delete List of records from these two tables in a single call.

Upvotes: 3

Views: 520

Answers (1)

Lukas Eder
Lukas Eder

Reputation: 220762

Yes, use DSLContext.batchDelete()

DSL.using(configuration)
   .batchDelete(record1, record2)
   .execute();

It'll generate JDBC batch statements for "similar" delete statements. If you're deleting from two tables, one record each, this will just generate two different delete statements.

Upvotes: 3

Related Questions