Hi Lukas,
Ah, okay, that's good to know.
> Also, as far as I know, the MySQL JDBC driver doesn't support fetching
> multiple generated IDs from bulk statements (i.e. statements with several
> records in the jOOQ VALUES() clause).
According to [1] that's sort of true. :-) Apparently, you can get back
the id of the *first* record inserted (which should allow you to
"calculate" the ids of the other records). So it would seem to be
possible. I'm going to try that.
Still, why didn't my second approach (DSLContext#insertInto) work?
According to the JavaDoc for #returning MySQL supports this? And
there's [2] which also seems to say that it should work. Or is it
still a bulk insert behind the scenes because they are all part of the
same TransactionalRunnable? (That would be a good thing, BTW.)
Cheers,
Hilco
[1]
https://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_last-insert-id
[2]
https://github.com/jOOQ/jOOQ/issues/3140