'Jooq batch insert/delete returning number of rows affected?
I am trying to batch insert and batch delete a large list of objects using JOOQ and Postgres, and get the number of rows inserted/deleted. I see there are insert(Collection<P> objects)
and delete(Collection<P> objects)
provided in JOOQ, however they don't return anything. From searching online I see there's also batchStore
that might return the number of inserted rows, which I am going to try. But what about delete?
Thanks!
Solution 1:[1]
I'm assuming that you meant these methods that don't return anything?
And by batchStore
you mean DSLContext.batchStore()
. So, would your answer just be to use DSLContext.batchDelete()
?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Lukas Eder |