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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top